Skip to main content

When You Should Choose Event Hubs Over IoT Hub for IoT Event Streaming

· 6 min read
Shunsuke Hioki
Full-Stack Engineer | Event Streaming Architect | Cloud Infrastructure Specialist

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

CapabilityIoT HubEvent Hubs
Primary focusComplete IoT device connectivity, management, and cloud-to-device controlHigh-throughput event streaming and real-time analytics pipelines
Supported protocolsMQTT, AMQP, HTTPSAMQP, HTTPS, Kafka (Standard tier and above)
Device managementDevice twins, direct methods, provisioning service, per-device identitiesNot provided; clients authenticate via shared access policies
Cloud-to-device messagingBuilt-in queues for commands and twin synchronizationNot available; downstream services must push responses
Scaling modelIoT Hub units bundle message quotas, throttles, and cloud-to-device limitsThroughput units allocate ingress/egress bandwidth and partitions
Pricing approachPay per hub unit with quotas for messages and featuresPay 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,000 messages per second
  • Each message payload is 1,000 bytes
  • 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.

IntervalMessage CountPayload Volume
Per second1,0001 MB
Per minute60,00060 MB
Per hour3,600,0003.6 GB
Per day86,400,00086.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.

  1. 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.

  2. 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).

    SizeDaily quotaApprox. price (USD/month)
    B1400,000$10
    B26,000,000$50
    B3300,000,000$500
  3. 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.

  4. Evaluate Cost Efficiency

    • B2 × 15 = ~$750/month
    • B3 × 1 = ~$500/month
      The B3 plan offers better value and comfortably meets the throughput requirement (see 1, 2, and 3).

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.

  1. 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.

  2. 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.

  3. 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

ResourcePlan and Size/UnitMax Daily Quota (Messages)Max Throughput per Second per UnitApprox. Price (USD/month)
IoT HubB3 with 1 unit300,000,0006,000500
Event HubsBasic with 1 TUNo limit (charged $0.028 per million events)1,00013.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):

ResourcePlan and Size/UnitMax Daily Quota (Messages)Max Throughput per SecondApprox. Price (USD/month)
IoT HubB3 with 1 unit300,000,0006,000500
Event HubsBasic with 1 TUNo limit (charged $0.028 per million events)1,00013.37
Event HubsBasic with 6 TUsNo limit (charged $0.028 per million events)6,00068.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.


References

  1. Azure IoT Hub Pricing
  2. Azure IoT Hub Scaling – Choose Your Size, Editions, and Units
  3. Azure IoT Hub Quotas and Throttling
  4. Azure Event Hubs Pricing
  5. Azure Event Hubs Scalability