Reputation: 584
It seems to me that Azure Web PubSub is a combination of both Event Grid and Event Hub using web sockets, instead of HTTP. However, I'm not 100% sure and could not find any articles that have a direct comparison between the 3 services.
Upvotes: 7
Views: 7981
Reputation: 1440
To answer your question let me explain all the three services one after another.
Azure Event Grid is a complete event routing service actively running on top of Azure Service Fabric. It issues events from various services like Azure Storage Blobs to different handlers like Azure Functions. It is event driven publish-subscribe model ( reactive programming).
Azure Event Grid can connect to any application that you create, and the Events generated by the application can be pulled and published to different other destinations.
Azure Event Hub is a data ingestion service that streams a huge count of messages from any source to provide an immediate response to business challenges. It streams millions of events per second from any source to build dynamic data pipelines and immediately respond to business challenges. Think it as multiple source big data streaming pipeline (telemetry data).
The difference between them is that Event Hubs are accepting only endpoints for the ingestion of data and they don’t provide a mechanism for sending data back to publishers. On the other hand, Event Grid sends HTTP requests to notify events that happen in publishers.
PubSub is the short form for Publish Subscribe. If you have ever used Azure SignalR or WebSockets before to send things between publisher and subscriber, then that is what Web PubSub also does. So Azure Web PubSub is a managed service for handling real-time communication with your application.
When you are using WebSockets, you have these long running connections between clients and app server but it gets tricky to scale them as you are handling long-running requests. This problem is solved by Web PubSub service, which comes in the middle of your clients and app server. Now your clients can talk to this server and you can do http in between Azure Web PubSub service and the App Server. So your app server remains http only, but all the hard WebSocket logic is handled by the service for you.
The Azure Web PubSub service is build on the same core fundamental platform as SignalR but the main difference between these two is Azure Web PubSub is purely serverless and in SingnalR you need to use SignalR client but with Web PubSub you can use any client and any language.
Lastly, I would suggest you to read these Choose between Azure messaging services and Azure Web PubSub documentation for more information.
Upvotes: 8