Collaboration on projects became difficult with the pandemic and people forced to work in isolation. Companies have learnt the importance of real-time connections between applications. When working on a team project, you would need to see the changes and work done by the members in real-time for efficiency.
Microsoft released Azure Web PubSub to help companies have a new generation of applications. With the help of the Azure platform, Microsoft will host a new service designed to have communications for one on one, one with many and many-to-many. This cost effective service is designed for building real-time web applications. It is also a fully-managed service that supports both server-less and native WebSockets.
Explaining the difference between Azure Web PubSub and SIgnalR Balan Subramanian the partner director of product management said, “Unlike SignalR, Azure Web Pubsub is just WebSockets; there’s no long-polling or server sent events fallback nor automatic reconnect; it’s just you and your WebSocket client. And lastly, if you’re using Azure SignalR continue to do so unless there’s something limiting you from using it in more places. This service won’t benefit you if that’s not the case.”
Interactive whiteboards, chat for streaming videos and IoT dashboards are real-time application scenarios that have grown popular. The preview of Azure Web PubSub service was announced to enhance user experience with real-time interactions. A standardized protocol is the WebSocket with full duplex communication. WebSockets are the base for this real-time web interaction.
With Azure Web PubSub you can use WebSockets with publish-subscribe pattern and easily build real-time web applications. For examples: live monitoring dashboards, real-time location on maps and cross-platform live chat.
Benefits of Using Azure Web PubSub
- This service supports large-scale real-time applications with highly available architectures. It allows multiple users to work together and scale to million connections. At the same time it supports various global regions for disaster recovery and sharding purposes.
- Azure Web PubSub can be used with a wide range of devices as it uses the raw WebSocket with publish-subscribe pattern.
- The service is a bi-directional messaging service that supports various messaging patterns with clients and servers.
Uses of Azure Web PubSub
This service can be used anywhere where real-time messaging through the server and clients are required. Traditional real-time features that use polling from the server or HTTP requests can also use this service. A number of different industries are using this service for their applications that require real-time updates.
Azure Web PubSub can be used for high frequency updates in gaming, voting, auctions and polling. Live chat rooms, real-time shopping assistant and in-game chatting are a few applications that can use this service to boost their productivity,
Getting Started with Azure Web PubSub
If you have worked on the Azure platform service, working with Web PubSub will be easy. Begin by using the Azure Portal to create a service instance and add it to a resource group. It then generates a client access URL that is stored on the portal. It comes with an access token which will verify clients against your service.
Once the service is enabled, use any standard WebSocket library to build a client. Since it is an open standard, you can use different libraries. Microsoft made things easier with the release of their own Python library. It fully supports Azure for authentication and endpoints. They are also working on a .NET library which will be released soon.
The library is easy to use. The first step is to create a WebPubSubServiceClient class that will hold authentication secrets and endpoints. After the class is created, you can use it to develop messages and send requests to your Azure hosted hub. Microsoft created a set of REST APIs for those who are not using a library.