When You Should Choose Event Hubs Over IoT Hub for IoT Event Streaming
Introduction
Have you ever wondered which service to choose for processing IoT telemetry on Azure — IoT Hub or Event Hubs?
Since IoT Hub has “IoT” in its name, some people might choose it instinctively. However, it actually depends on the requirements of your system.
In this post, I’ll walk through the requirements and the math that led me to choose Event Hubs.
General Comparison of IoT Hub and Event Hubs
| Capability | IoT Hub | Event Hubs |
|---|---|---|
| Primary focus | Complete IoT device connectivity, management, and cloud-to-device control | High-throughput event streaming and real-time analytics pipelines |
| Supported protocols | MQTT, AMQP, HTTPS | AMQP, HTTPS, Kafka (Standard tier and above) |
| Device management | Device twins, direct methods, provisioning service, per-device identities | Not provided; clients authenticate via shared access policies |
| Cloud-to-device messaging | Built-in queues for commands and twin synchronization | Not available; downstream services must push responses |
| Scaling model | IoT Hub units bundle message quotas, throttles, and cloud-to-device limits | Throughput units allocate ingress/egress bandwidth and partitions |
| Pricing approach | Pay per hub unit with quotas for messages and features | Pay per throughput unit plus optional features like capture |
Requirements
Let's assume the system we need to build has the following requirements:
- Ingestion workload of
1,000messages per second - Each message payload is
1,000bytes - No need for cloud-to-device operations such as direct methods or digital twins
- Edge device uses HTTP to send data
Message Volume
Let's calculate the message volume to choose an appropriate plan, since the number of messages per second and per day determines which plan and how many units we need for IoT Hub and Event Hubs.
| Interval | Message Count | Payload Volume |
|---|---|---|
| Per second | 1,000 | 1 MB |
| Per minute | 60,000 | 60 MB |
| Per hour | 3,600,000 | 3.6 GB |
| Per day | 86,400,000 | 86.4 GB |
The load works out to 1 MB/s on average (based on 1 KB messages), which fits comfortably within a single Event Hubs throughput unit and also helps us size the IoT Hub.
Plan Selection
Thanks to the previous section, now we know how many events we have to process.
How I Narrowed Down the IoT Hub Plan
After calculating that the system needs to handle 86.4 million messages per day, the next step was to determine which IoT Hub plan and size could handle that load efficiently.
-
Basic or Standard
IoT Hub offers Basic and Standard plans.
The Standard plan includes bidirectional operations such as Direct Methods and Device Twins, but since our system doesn’t require these features (as stated in the requirements), the Basic plan is sufficient. -
Basic Tier Options
IoT Hub provides three Basic sizes — B1, B2, and B3 — each with different daily message quotas and pricing (see 1 and 2).Size Daily quota Approx. price (USD/month) B1 400,000 $10 B2 6,000,000 $50 B3 300,000,000 $500 -
Compare Capacity to Requirement
The system’s daily message volume of 86.4 million far exceeds the limits of B1 and B2.
It would take about 15 units of B2 (6 million × 15 = 90 million) to cover the load, which already costs more than a single B3. -
Evaluate Cost Efficiency
✅ Result:
B3 plan with one unit is the smallest plan that meets the throughput requirement, and its cost is $500/month.
How I Narrowed Down the Event Hubs Plan
Let's select the plan and number of units for Event Hubs as well.
-
Basic, Standard, Premium, or Dedicated
Event Hubs offers Basic, Standard, Premium, and Dedicated plans.
Plans higher than Basic offer Event Capture, Schema Registry, and Apache Kafka support. However, we don’t need those features in our system, so let’s choose Basic here. -
Basic Tier Options
Event Hubs doesn't offer “sizes” like IoT Hub does — the number of Throughput Units (TUs) determines throughput and cost (see 4 and 5).
One TU can process up to about 1 MB/s or 1,000 events per second for ingestion, so one TU is sufficient. -
Cost Calculation
The Basic tier of Event Hubs costs $0.015 per TU-hour and $0.028 per million events (see 4).
We chose 1 TU, and the total number of events per month is 86.4 million, so the total monthly cost is around $13.37.
✅ Result:
Basic with 1 TU is the smallest plan that meets the throughput requirement, and its cost is $13.37/month.
Results Comparison
| Resource | Plan and Size/Unit | Max Daily Quota (Messages) | Max Throughput per Second per Unit | Approx. Price (USD/month) |
|---|---|---|---|---|
| IoT Hub | B3 with 1 unit | 300,000,000 | 6,000 | 500 |
| Event Hubs | Basic with 1 TU | No limit (charged $0.028 per million events) | 1,000 | 13.37 |
Event Hubs costs roughly 45× less than IoT Hub for this ingestion-only workload while still meeting the throughput requirement.
Looking at the table, Event Hubs is clearly cheaper, but IoT Hub offers about six times higher throughput per unit. Some of you might think it’s worth $500/month if you expect spikes of up to 6,000 messages per second in your system.
However, if you try to achieve the same throughput with Event Hubs, the cost would be as shown below (assuming the total number of messages stays the same):
| Resource | Plan and Size/Unit | Max Daily Quota (Messages) | Max Throughput per Second | Approx. Price (USD/month) |
|---|---|---|---|---|
| IoT Hub | B3 with 1 unit | 300,000,000 | 6,000 | 500 |
| Event Hubs | Basic with 1 TU | No limit (charged $0.028 per million events) | 1,000 | 13.37 |
| Event Hubs | Basic with 6 TUs | No limit (charged $0.028 per million events) | 6,000 | 68.12 (*) |
* 6 TUs × 730 hours × $0.015/TU-hour + (0.028 × 86.4) = $68.12
So even with equivalent throughput, Event Hubs remains significantly more cost-efficient.
Conclusion
Choose Event Hubs if your IoT system meets the following conditions:
- You only need data ingestion and do not require device management or cloud-to-device operations
- Your clients can use AMQP or HTTPS (you’ll need the Standard tier if you require Kafka)
Choose IoT Hub if you need MQTT, bidirectional device management, or built-in integrations such as device twins.