'Azure event grid vs service bus

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.



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 zolty13