Event Hubs Vs Service Bus (2024)

Event vs. message services

There's an important distinction to note between services that deliver an event and services that deliver a message.

Event

An event is a lightweight notification of a condition or a state change. The publisher of the event has no expectation about how the event is handled. The consumer of the event decides what to do with the notification. Events can be discrete units or part of a series.

Discrete events report state change and are actionable. To take the next step, the consumer only needs to know that something happened. The event data has information about what happened but doesn't have the data that triggered the event. For example, an event notifies consumers that a file was created. It may have general information about the file, but it doesn't have the file itself. Discrete events are ideal for serverless solutions that need to scale.

Series events report a condition and are analyzable. The events are time-ordered and interrelated. The consumer needs the sequenced series of events to analyze what happened.

Message

A message is raw data produced by a service to be consumed or stored elsewhere. The message contains the data that triggered the message pipeline. The publisher of the message has an expectation about how the consumer handles the message. A contract exists between the two sides. For example, the publisher sends a message with the raw data, and expects the consumer to create a file from that data and send a response when the work is done.

Difference betweenEvent Hubs&Service Bus

To the external publisher or the receiverService BusandEvent Hubscan look very similar and this is what makes it difficult to understand the differences between the two and when to use what.

1.Event Hubsfocuses on event streaming whereService Busis more of a traditional messaging broker.

2.Service Busis used as the backbone to connects applications running in the cloud to other applications or services and transfers data between them whereasEvent Hubsis more concerned about receiving massive volume of data with high throughout and low latency.

3.Event Hubsdecouples multiple event-producers from event-receivers whereasService Busaims to decouple applications.

4.Service Busmessaging supports a message property ‘Time to Live’ whereas Event Hubs has a default retention period of 7 days.

5.Service Bushas the concept of message session. It allows relating messages based on their session-id property whereas Event Hubs does not.

6.Service Busthe messages are pulled out by the receiver & cannot be processed again whereas Event Hubs message can be ingested by multiple receivers.

7.Service Bususes the terminology of queues and topics whereasEvent Hubspartitions terminology is used.

Use this loose general rule of thumb.

SOMETHING HAS HAPPENED –Even Hubs

DO SOMETHING or GIVE ME SOMETHING –Service Bus

Event Hubs Vs Service Bus (2024)
Top Articles
Latest Posts
Article information

Author: Prof. An Powlowski

Last Updated:

Views: 5843

Rating: 4.3 / 5 (44 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Prof. An Powlowski

Birthday: 1992-09-29

Address: Apt. 994 8891 Orval Hill, Brittnyburgh, AZ 41023-0398

Phone: +26417467956738

Job: District Marketing Strategist

Hobby: Embroidery, Bodybuilding, Motor sports, Amateur radio, Wood carving, Whittling, Air sports

Introduction: My name is Prof. An Powlowski, I am a charming, helpful, attractive, good, graceful, thoughtful, vast person who loves writing and wants to share my knowledge and understanding with you.