← Return To Home

Azure Service Bus, Event Hub, Event Grid – which one to choose?

Three different Azure messaging technologies to choose one from Azure service bus, Azure event hub, Azure event grid

When more and more technologies are at your disposal doing pretty much identical things it becomes confusing to decide which one to chose and what is the benefit of choosing one over the other.

You can download this blog as a PDF file for an offline read. Free Download Now

At the face of it, the technologies might look like they are doing pretty much the same thing, but there might be significant differences and there is a reason for their existence.

Azure Service Bus, Event Hub and Event Grid are the key messaging technologies available in Microsoft Azure today, in fact, all these three technologies are built and maintained by the same team. Why do you need 3 different technologies for messaging?

Recently this question came on one of the internal Azure Service Bus Advisory meeting and Dan Rosanova (Principal Program Manager Lead) gave a great explanation taking an E-Commerce example where you use different technologies for different types of messaging in the same solution.

It’s a great explanation and gives great clarity, hence I documented it here.

Azure Service Bus

Azure Service Bus monitoring and management to handle queues, topics and their messages and properties

When you have a shopping cart, when you’re buying stuff, and when you’re moving money or material you would probably use Azure Service Bus because you want transactions, you want instantaneous consistency, you want to be able to have temporal control like if this is not processed in x amount of minutes then dead letter it or send it somewhere else for an escalation. When you want these kinds of orchestrated (workflow) stuff to do state transitions then you’ll be using Azure Service Bus. It’s really like IBM MQ or BizTalk Server, however at cloud scale. In a nutshell, when you need robustness and cannot afford to lose any messages, you’ll go for Azure Service Bus.

Azure Event Grid

Azure Event Grid monitoring and management to achieve critical tasks like Event Processing and evaluating publish performance.

When you’re actually shipping and moving stuff, where you are reacting to things like item has been pulled from the shelf, item was bought to postal area, item has been shipped, or this shipment was rejected and so on, in this case instead of doing a central control workflow you would do in an Event-based model running active workflows for each product item.  Here you are reacting to real changes in real time. Azure Event Grid is ideal for these kinds of reactive scenarios. 

Azure Event Hub

 Azure Event Hubs monitoring and management capabilities over partitions and consumer groups.

Azure Event Hub is used more for the telemetry scenarios. Let’s say if every component that’s been used in the Enterprise for this e-commerce application emits telemetry data like Log4Net or Log4J and you wanted to capture it, then you’ll use Azure Event Hub. A great example is Azure Application Insights, under the hood it uses Azure Event Hub to capture the telemetry information.

Hope this helps to clarify the need for 3 different messaging platforms in Microsoft Azure and when to use them appropriately. 

Author: Saravana Kumar

Saravana Kumar is the Founder and CEO of Kovai.co. Entrepreneur, Investor, and Technical enthusiast. Passionate about running and scaling a company in a profitable way with calculated risks.