14

Would it be fair to say that an event grid is just a subset of a service bus ? I am finding that service bus can do everything that an event grid can do and much more.

3

1 Answer 1

43

Would it be fair to say that an event grid is just a subset of a service bus?

I wouldn't try to equate these services. They both deal with messages but have a very different purpose. As well as implementation details when it comes to usage.

Azure Service Bus is an enterprise messaging product. It covers queuing, pub/sub, and has multiple compute based features. Receiving is done via polling (long polling) and usually, a namespace is accessed within/by a single organization.

Azure Event Grid is a notification service. Its sole purpose is to enable pub/sub between event generators and subscribers. It has no queuing semantics. Message delivery is push-based and only a few compute based features are available unlike with Service Bus. The service is design to allow communication between multiple parties and can span multiple organizations as published and/or subscribers.

I am finding that service bus can do everything that an event grid can do and much more.

It might look that way, but not quite. Azure Service Bus and Event Grid limits and constraints are quite different. For example, an Azure Service Bus namespace is constrained to a single region. Event Grid is global and doesn't have that kind of constraint. Service Bus has a limited number of connections required to poll the messages where Event Grid has a much larger number of subscribers that can be pushed messages. Naturally, the delivery method is different (poll vs push), and more.

If you need pub/sub within an organization, Service Bus would do. Once you need to push notifications about certain events outside of the organization, that's where Event Grid shines. The two can also be mixed. Events from Event Grid can be queued up using Service Bus queues or topics for levelling workloads.

Last Service Bus pros is that there are better event viewers like Service Bus Explorer, whereas there is nothing similar for Event Grid.

Event grid should be used when you want to integrate with Azure native events coming from Azure resources (e.g. Blob Created Event from Azure Blob Storage, Subscription events etc.). You can still put Service bus between Event Grid and targeted event subscriber to ensure resilience and load leveling.

4
  • can you compare event hub as well with event grid/service bus ? THanks Jul 23, 2020 at 7:42
  • 9
    Event Hubs is an ingestor. It's purpose is to allow capturing a large volume of messages (think telemetry type of volume) for processing. The most noticeable difference is that data is stored and not delivered anywhere. You would need to create "readers" and manage the cursor yourself. Alternatively, data can be offloaded into Storage account or Data Lake for later processing. I usually differentiate between EH and EG by focusing on the value of a single event. With EH a single event is meaningless. The stream as a whole is important. With EG every event is important as it has business value. Jul 24, 2020 at 6:08
  • 1
    I have read your answer. I still believe if you have a Azure Service Bus which offer you Pub/Sub and queuing functionality, you don't need to have an Event Grid. When you have a queue and a Logic App can subscribe to the queue to get the messages, why you should still use an Event Grid between them? It is unnecessary. Because as soon as a new message comes into the queue (or Topic), the Logic App will get it. And why I need to notify the Logic App by the Event Grid?
    – user217648
    May 27, 2021 at 7:54
  • 6
    If you have an Azure Service Bus access. When you have multiple subscribers interested in events that are outside of your trust network, you are not going to hand them out a connection string to your service bus. Rather you'd like to push a notification/message to a webhook that the subscriber will provide. Imagine hundreds if not thousands interested subscribers and the need to modify them all with an updated connection string. It really depends on the scenario you're handling. If you can trust the subscribers to connect to the broker, great, use ASB only. Otherwise, EG. May 27, 2021 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.