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.
-
Not really sure, but I think Azure Web Pub/Sub is based on WebSockets and allows *real time communication* about occuring events (Push model)). The Event Grid is more MQTT like where the consumer regulary checks for any new available events (Pull model). – Oliver Nov 22 '21 at 09:45
-
If the posted answer helped, you may mark it as the answer by clicking the check mark. Doing so can help other community members. – SauravDas-MT Nov 25 '21 at 06:56
-
@SauravDas-MT thanks for answering below. I had a follow up question to your post. – TDao Dec 12 '21 at 04:21
1 Answers
To answer your question let me explain all the three services one after another.
Azure Event Grid
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
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.
Azure Web PubSub
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.

- 1,224
- 1
- 4
- 10
-
Can't Event Grid be used to send event back to the client like Web PubSub? It seems to me that Event Grid and Web PubSub are both doing pub-sub pattern and delivering events in real time. Also how's event hub different from Application Insights if it's just for telemetry digestion? – TDao Nov 25 '21 at 16:06
-
2@TDao Event Grid seems to be intended for pub/sub among Azure services. It's kinda hard to connect desktop or mobile apps to Event Grid.. you can send events to web hooks and that's about it. They don't work well for moving targets like desktop / mobile apps though. Azure Web PubSub is intended for pub/sub among clients outside of Azure. – stmax Apr 11 '22 at 14:40