Azure Event Hubs vs Service Bus: Event Streaming or Message Queues?

Updated on November 30, 20267.9

Azure Event Hubs and Azure Service Bus both receive data from producers and make it available to consumers. The difference is what happens to that data after it arrives. Event Hubs retains a stream that independent readers can process and replay. Service Bus distributes messages to receivers that settle individual units of work.

Use Azure Event Hubs for large streams of telemetry, logs, clickstream data or other events that may need to be read repeatedly. Use Azure Service Bus for reliable business-message processing, where a worker must handle and acknowledge an individual order, request or task. Higher throughput alone is not a reason to replace a work queue with an event stream.

Microsoft’s official product name is Azure Event Hubs, although searches commonly use the singular Azure Event Hub vs Service Bus. If you are evaluating notification routing rather than streaming, read Azure Service Bus vs Event Grid.

Azure Event Hubs vs Service Bus at a glance

Feature Azure Event Hubs Azure Service Bus
Primary role Event ingestion and streaming Business message broker
Data model Append-only partitioned log within configured retention Queues and topic subscriptions
Reading model Consumers read partitions at positions Consumers receive and settle messages
Replay Read retained events again from earlier positions Completed messages are removed from that queue or subscription
Fan-out Independent consumer groups Topic subscriptions with their own message copies
Ordering Within a partition Within a session when appropriately configured
Failure handling Checkpoints, retries and application-designed poison event handling Lock, settlement, retry and dead-letter mechanisms
Typical workloads IoT readings, application logs, stream analytics Orders, invoicing jobs, enterprise integrations

How Azure Event Hubs works

Event Hubs accepts streams of events and stores them across partitions. Each partition is an ordered sequence within its retention window. Producers can use partition keys to keep related records together when ordering matters, or let the service distribute events according to supported routing behavior.

Consumers read the stream using positions such as offsets or sequence numbers. A checkpoint records how far a consumer has processed. If an application restarts, it can resume from its checkpoint; if it deliberately needs to rebuild an analytical result, it can read from an earlier position while the events remain available.

Consumer groups

A consumer group provides an independent view of the stream. A fraud-detection application, a monitoring dashboard and a data lake ingestion job can use separate groups and maintain their own progress without deleting events for one another. Within a group, partition ownership is commonly coordinated by a consumer processor so multiple instances can share the work.

Retention and long-term storage

Event Hubs retains events for a configured period within tier limits. Reading an event does not delete it, but retention is not indefinite. For long-term analytics, use a suitable storage destination, such as Event Hubs Capture where supported, and define a separate archival and reprocessing strategy.

Event Hubs also offers an Apache Kafka-compatible endpoint in supported configurations. It can reduce migration effort for compatible Kafka producers and consumers, but verify protocol and feature differences rather than assuming it is identical to a self-managed Kafka cluster. Microsoft’s Event Hubs overview explains these concepts.

How Azure Service Bus works

Service Bus provides queues and topics. A queue distributes messages among competing receivers. A topic publishes to subscriptions, each with its own message lifecycle. A worker can receive a message using Peek-Lock, perform the task and complete it once processing succeeds. A failed operation can result in redelivery or dead-lettering under the configured policy.

This model is especially useful when each message represents work that must be tracked individually. Broker capabilities such as sessions, scheduled messages, duplicate detection and transactions provide building blocks for controlled business processing. The application’s own consistency logic remains essential, particularly when updating databases or external payment systems.

Replay versus reprocessing: the decisive difference

Suppose a company ingests 10 million sensor readings each day. On Friday, an analyst discovers that a calculation introduced on Wednesday was wrong. If the required raw events are still retained, an Event Hubs consumer can use an earlier position to recompute the results. The production consumer can continue independently in a separate consumer group.

Now suppose a company receives a command to issue a customer refund. The payment worker should complete that command after the intended transaction is recorded. A new worker should not replay all successfully completed refund commands just to reconstruct its local state. Service Bus aligns more naturally with this work-processing contract.

Neither model is inherently exactly once. An Event Hubs consumer may write an analytical result and crash before saving its checkpoint; after restart it may process the same event again. A Service Bus consumer may commit an effect and lose its message lock before settlement. Both require idempotent processing or an appropriate transactional consistency strategy.

Scaling and ordering

Event Hubs uses partitions as a key unit of parallel consumption. More consumer instances do not necessarily produce more throughput if the number of available partitions or the downstream database is the bottleneck. A partition key that concentrates most traffic on one partition can create skew. Select keys based on actual event distribution and any required per-entity ordering.

Service Bus scaling involves receiver concurrency, lock duration, queue depth, namespace capacity and downstream constraints. For example, a worker pool receiving too many messages at once may hold locks while waiting for database connections. Excessive concurrency can cause lock loss and repeated deliveries. Tune prefetch, processing concurrency and lock renewal together rather than maximizing each setting independently.

Event Hubs provides order within a partition, not across every partition. Service Bus sessions can support ordered processing of related messages, provided the consumer honors the ordering requirements. If a system demands global ordering, evaluate the resulting throughput and availability trade-offs explicitly.

Event Hubs vs Service Bus pricing

Event Hubs pricing depends on the tier, capacity model, ingestion, retention and optional capabilities such as Capture. Service Bus pricing depends on its tier, operations or provisioned capacity. Include storage, network traffic, consumer compute, observability and recovery overhead for either design.

For example, 5,000 devices publishing one 1 KB record every ten seconds produce around 500 events per second and 43.2 million events per day, approximately 43.2 GB of raw payload daily using decimal units. Actual metered volume can differ because of batching, protocol overhead and service-specific rules. That calculation helps size a streaming workload; it does not establish how many capacity units or what tier you need.

In contrast, 20,000 order-processing messages a day may have modest throughput but a high cost of lost or repeated business effects. Select the message-processing model first. Estimate the tier, message operations, capacity and consumer resources second.

Refer to Event Hubs pricing and Service Bus pricing for the current region and plan.

When should you choose each service?

Scenario Recommended service Reason
Stream factory sensor readings Event Hubs Continuous ingestion and independent analytical consumers
Collect application logs for analytics Event Hubs Partitioned stream and replay capability
Process customer refund commands Service Bus Individual settlement and controlled failure recovery
Rebuild a dashboard from retained raw events Event Hubs Start a consumer at an earlier stream position
Coordinate invoice processing between systems Service Bus Queue or subscription-based work ownership
React to a newly created cloud resource Event Grid Notification routing rather than persistent stream or business command

Using both services in one architecture

A fleet management application can ingest vehicle telemetry into Event Hubs. An analytical consumer detects a maintenance condition and writes a durable record that a maintenance task is required. A publisher sends a command to Service Bus so an independent workflow can create a work order and notify the correct team.

This separation lets the analytical pipeline replay telemetry without automatically repeating business tasks. The transition between analytics and commands needs an explicit idempotency key, such as a stable maintenance-event identifier, so reprocessing a stream does not create duplicate work orders. A durable outbox can help coordinate the business record and command publication.

For handler implementation, see Azure Functions vs Logic Apps. A code-first function can implement custom stream logic, while a workflow can coordinate follow-up system integrations.

Production checklist: what to monitor

For Event Hubs, track incoming event rates, throttling, consumer progress and partition imbalance. Alert on processing delay relative to the retention window, since an extremely delayed consumer can lose access to older events. Design a poison-event strategy that records invalid data for inspection without indefinitely blocking an entire partition.

For Service Bus, track active messages, oldest message age, dead-letter counts, settlement failures and downstream processing latency. Exercise lock expiry, repeated messages and worker restarts. Use supported identity-based authentication, least-privilege access and correlation IDs in either system.

Microsoft’s asynchronous messaging architecture guide and messaging service comparison provide additional design guidance.

Frequently asked questions

Is Event Hubs a message queue?

Not in the conventional settlement-based sense. It is a partitioned event streaming service in which reads do not remove events from the retained log.

Does Service Bus support publish-subscribe messaging?

Yes. Topics and subscriptions allow independent receivers to handle their own copies of messages.

Does Event Hubs have a built-in dead-letter queue like Service Bus?

Not as a general per-event settlement mechanism for stream consumers. Applications usually implement their own invalid-event handling and recovery strategy.

Which service is faster?

Event Hubs is designed for large event streams, but latency and throughput depend on tier, workload and consumers. Benchmark the actual architecture rather than treating the services as interchangeable.

Final verdict

Choose Event Hubs when data is a retained stream and independent consumption or replay matters. Choose Service Bus when individual messages represent work that receivers must settle. The strongest architecture often uses streams for observation and queues for action, with a carefully designed boundary between them. For the broader platform context, read our Microsoft Azure guide.

About the Author: Jian Brant

Founder Jian Brant
Jian Brant is a technology professional and founder of Punch5Media, with extensive experience in web development, enterprise IT, business analysis and digital transformation. Drawing on his experience across public and private sector organizations, he delivers thoroughly researched, practical insights into technology, cybersecurity, software and digital business.

Share this article

Explore technology

Practical, independent technology guides and explanations.

Browse all articles →

Recent articles

Our editorial approach

Clear explanations, practical guidance and responsible research.

Editorial standards →