Event Grid vs Event Hub Comparison and Use Cases
Azure Event Grid and Azure Event Hub are both event services on Azure, but they serve fundamentally different purposes. Choosing the wrong service creates either an over-engineered solution or a system that cannot handle the required load. This topic provides a definitive comparison to help make the right choice for every scenario.
The Core Difference in One Line
| Service | Primary Purpose |
|---|---|
| Azure Event Grid | React to discrete events — something happened, notify interested parties |
| Azure Event Hub | Ingest continuous high-volume data streams for real-time and batch processing |
Mental Model: Event Grid vs Event Hub
EVENT GRID – "Something Happened, Tell Them Now" A file uploaded --> notify thumbnail generator A VM deleted --> notify the security team A secret expired --> notify the DevOps team These are discrete, low-frequency, important notifications. One event triggers one (or a few) specific reactions. ──────────────────────────────────────────────────────────── EVENT HUB – "Continuous Data Firehose" 1,000 sensors each emit readings every second A website generates 5,000 page-view events per minute A trading platform processes 50,000 transactions per minute These are continuous, high-frequency, analytical data streams. Events are processed in aggregate to derive insights or stored for analysis.
Detailed Feature Comparison
| Feature | Azure Event Grid | Azure Event Hub |
|---|---|---|
| Primary pattern | Event-driven notification (pub/sub routing) | Event streaming and telemetry ingestion |
| Throughput | Millions of events/day (designed for moderate volume with spikes) | Millions of events/second (designed for sustained high volume) |
| Typical event frequency | Low to medium (discrete occurrences) | Very high (continuous streams) |
| Event size limit | 1 MB per event | 1 MB per event |
| Event retention | Up to 24 hours (retry window only) | 1 to 90 days (accessible for replay) |
| Multiple consumers | Multiple subscriptions each get a copy of the event | Multiple consumer groups each read the full stream independently |
| Event ordering | Not guaranteed | Guaranteed within a partition |
| Delivery model | Push (Event Grid pushes to registered handlers) | Pull (consumers request events from partitions) |
| Filtering | Rich filtering: event type, subject, advanced field filters | Filtering handled in consumer application code |
| Replay | Not supported | Supported within the retention window |
| Schema enforcement | Optional: Event Grid Schema or CloudEvents 1.0 | No schema enforcement (schema registry available separately) |
| Dead lettering | Built-in to subscriptions (saves to Blob Storage) | Not applicable (events remain in partitions until retention expires) |
| Kafka compatibility | No | Yes (Standard, Premium, Dedicated tiers) |
| MQTT support | Yes (Event Grid Namespaces) | No |
| Third-party integration | Partner Topics (Auth0, SAP, Microsoft Graph) | No built-in partner integrations |
| Pricing model | Per operation (publish, deliver, advanced match) | Per throughput unit and retention |
| Minimum cost | Free (first 100,000 operations/month) | Charged by the hour per throughput unit |
| Infrastructure management | Fully managed, no configuration for scaling | Managed but requires capacity planning (TUs/PUs) |
Event Grid Handlers vs Event Hub Consumers
| Aspect | Event Grid (Handlers) | Event Hub (Consumers) |
|---|---|---|
| How events arrive | Event Grid pushes to the handler endpoint (HTTP POST) | Consumer application pulls from Event Hub partition |
| Consumer readiness | Handler must be online and respond within timeout | Consumer can be offline; events wait in partitions |
| Failed delivery handling | Automatic retry with dead-letter for persistent failures | Consumer resumes from last checkpoint after restart |
| Processing model | One event per invocation (one event triggers one function call) | Batch processing (consumer reads multiple events per poll) |
Scenario Decision Matrix
| Scenario | Recommended Service | Reason |
|---|---|---|
| Blob Storage upload triggers image processing | Event Grid | Single discrete event triggers a specific action |
| Alert when an Azure resource is deleted | Event Grid | Resource lifecycle event requires immediate notification |
| Trigger CI/CD pipeline on container image push | Event Grid | Discrete event from Azure Container Registry |
| IoT telemetry from 50,000 sensors | Event Hub | Continuous high-volume stream requires partition-based ingestion |
| Website clickstream analysis | Event Hub | Millions of events per minute; requires windowed stream analytics |
| Financial transaction fraud detection | Event Hub | High-frequency stream; ML model scores each event in real-time |
| Microservices notification (order placed → inventory updated) | Event Grid | Discrete business event routing between loosely coupled services |
| Application log aggregation from 100 servers | Event Hub | Continuous log stream; needs replay and long-term retention |
| Key Vault secret expiry notification | Event Grid | Azure system event; infrequent and action-oriented |
| Building a data pipeline that feeds Azure Synapse | Event Hub | High-volume ingestion + Capture to ADLS feeds Synapse directly |
| Third-party SaaS events (Auth0 login events) | Event Grid | Partner Topics provide direct integration with Auth0 |
| Kafka migration to Azure | Event Hub | Event Hub has native Kafka protocol support |
Can Event Grid and Event Hub Work Together?
Yes. Event Grid and Event Hub complement each other and are commonly used together in the same architecture.
Pattern 1: Event Grid Feeds Event Hub
Multiple Azure resource events (Blob, IoT Hub, Resource Manager)
--> Multiple Event Grid System Topics
--> Event Grid routes all events to a single Event Hub
--> Event Hub buffers and distributes to analytics consumers
Use case: Centralize events from many Azure services into one
high-throughput ingestion point for unified analytics
Pattern 2: Event Hub Feeds Event Grid
IoT devices --> Event Hub (ingestion)
--> Azure Stream Analytics processes stream
--> Stream Analytics output triggers an Azure Service Bus message
--> Event Grid Service Bus system topic notifies handlers
--> Azure Function sends alert to operations team
Use case: Ingest at scale with Event Hub; react to processed results
using Event Grid for lightweight notification
Pattern 3: Side-by-Side in Microservices
Order Service:
Discrete business events (OrderPlaced, OrderCancelled)
--> Event Grid Custom Topic
--> Inventory and Shipping services subscribe and react
Analytics Service:
All order events + clickstream + user behavior
--> Event Hub "analytics"
--> Stream Analytics for real-time dashboards
--> Capture to ADLS for batch reporting
Quick Selection Guide
Ask these questions: 1. Is the event discrete (something happened once)? --> Event Grid 2. Is the volume continuous and very high (thousands+ per second)? --> Event Hub 3. Does the consumer need to replay past events? --> Event Hub 4. Does the producer need a simple push notification to multiple services? --> Event Grid 5. Is Kafka compatibility required? --> Event Hub 6. Is this a third-party SaaS event (Auth0, SAP)? --> Event Grid (Partner Topics) 7. Is this IoT telemetry at scale? --> Event Hub 8. Is this an Azure resource lifecycle event? --> Event Grid (System Topics)
When to Use Azure Service Bus Instead
Some scenarios fit neither Event Grid nor Event Hub. Azure Service Bus is the right choice when:
- Message ordering within a group is required (sessions)
- Exactly-once processing is required (transactions)
- Messages must be acknowledged and deleted after processing (competing consumers)
- The message size exceeds 1 MB (Service Bus Premium supports up to 100 MB)
- Long message time-to-live is needed (Service Bus supports up to 14 days or unlimited)
Summary Comparison Diagram
LOW FREQUENCY HIGH FREQUENCY
(Discrete Events) (Continuous Streams)
+──────────────────────────────────────────────+
PUSH | Azure Event Grid | Not ideal |
(Server | (Recommended) | Use Event Hub instead|
pushes to +──────────────────────+──────────────────────+
consumer) | |
+──────────────────────────────────────────────+
PULL | Azure Service Bus | Azure Event Hub |
(Consumer | (for task queues) | (Recommended) |
fetches) +──────────────────────+──────────────────────+
Course Summary
Azure Event Grid and Azure Event Hub are purpose-built services for different types of event workloads. Event Grid excels at discrete, notification-style events with rich routing, filtering, and delivery guarantees. Event Hub excels at massive, continuous data streams with replay, partitioned consumption, and seamless analytics integration. The most powerful architectures use both services together — Event Grid for reactive notifications and Event Hub for high-throughput data pipelines.
