Choose between Azure Event Grid and Event Hubs

This article describes the basic understanding of these two services, and help us understand which one to choose for our application. Let us start with basic understanding of these two services.

Event Grid

Event Grid is a fully-managed event routing service and the first of its kind. Azure Event Grid greatly simplifies the development of event-based applications and simplifies the creation of serverless workflows. Using a single service, Azure Event Grid manages all routing of events from any source, to any destination, for any application.

It uses a publish-subscribe model. Publishers emit events, but have no expectation about which events are handled. Subscribers decide which events they want to handle.

Event Grid supports dead-lettering for events that aren’t delivered to an endpoint.

It has the following characteristics:

dynamically scalable
low cost
at least once delivery

Event Hubs

Event Hubs is a Big Data streaming platform and event ingestion service, capable of receiving and processing millions of events per second. Event Hubs can process and store events, data, or telemetry produced by distributed software and devices

It facilitates the capture, retention, and replay of telemetry and event stream data. The data can come from many concurrent sources. Event Hubs allows telemetry and event data to be made available to a variety of stream-processing infrastructures and analytics services. It is available either as data streams or bundled event batches.

This service provides a single solution that enables rapid data retrieval for real-time processing as well as repeated replay of stored raw data. It can capture the streaming data into a file for processing and analysis.

It has the following characteristics:

low latency
capable of receiving and processing millions of events per second
at least once delivery

In some cases, we use the services side by side to fulfill distinct roles. For example, an e-commerce site can use Service Bus to process the order, Event Hubs to capture site telemetry, and Event Grid to respond to events like an item was shipped.

Choose Event Grid when

  • Simplicity: It is straightforward to connect sources to subscribers in Event Grid.
  • Advanced filtering: Subscriptions have close control over the events they receive from a topic.
  • Fan-out: You can subscribe to an unlimited number of endpoints to the same events and topics.
  • Reliability: Event Grid retries event delivery for up to 24 hours for each subscription.
  • Pay-per-event: Pay only for the number of events that you transmit.

Choose Event Hubs when

  • You need to support authenticating a large number of publishers.
  • You need to save a stream of events to Data Lake or Blob storage.
  • You need aggregation or analytics on your event stream.
  • You need reliable messaging or resiliency.

I hope this will help !!!

NOTE — Reference taken from Microsoft Learning Site