Need advice about which tool to choose?Ask the StackShare community!
Azure Notification Hubs vs Azure Service Bus: What are the differences?
Introduction
Azure Notification Hubs and Azure Service Bus are both messaging services provided by Microsoft Azure. While they share some similarities, there are key differences between them that make them suitable for different use cases.
1. Scalability and Pub/Sub Model: Azure Notification Hubs is designed for high-scale push notifications and supports a publish-subscribe (pub/sub) model. It allows sending push notifications to multiple platforms (such as iOS, Android, Windows) simultaneously. In contrast, Azure Service Bus is a general-purpose messaging system that supports both pub/sub and point-to-point messaging patterns. It is highly scalable and can handle large volumes of messages efficiently.
2. Protocol Support and Message Delivery: Azure Notification Hubs primarily supports push notifications over commonly used protocols like Firebase Cloud Messaging (FCM), Apple Push Notification Service (APNS), and Google Cloud Messaging (GCM). On the other hand, Azure Service Bus provides support for various protocols like AMQP, WebSocket, and HTTP, offering more flexibility in message delivery.
3. Message Ordering and Replay: Azure Service Bus supports message ordering, ensuring that messages are processed sequentially within a specific session. This can be useful in scenarios that require strict ordering of messages. However, Azure Notification Hubs does not provide built-in support for message ordering. Additionally, Azure Service Bus also offers a replay feature, allowing messages to be resent and processed again if needed.
4. Message Length and Size Limitations: Azure Notification Hubs imposes restrictions on the payload size of push notifications. For example, FCM imposes a maximum limit of 4KB for the notification payload. On the other hand, Azure Service Bus has a maximum message size limit of 256KB, allowing for larger payloads to be transported.
5. Message Reliability and Retry Policies: Azure Service Bus ensures message reliability through features like duplicate detection, transactional support, and dead-letter queues. It also provides a rich set of retry policies to handle transient failures during message delivery. In comparison, Azure Notification Hubs does not offer the same level of message reliability and retry policies.
6. Target Audience and Use Cases: Azure Notification Hubs is primarily intended for mobile applications and scenarios that require sending push notifications to a large number of devices across multiple platforms. It is commonly used in mobile marketing campaigns, news updates, and real-time alerts. On the other hand, Azure Service Bus is suitable for a wide range of enterprise messaging scenarios, including inter-application communication, event-driven architectures, and high-throughput messaging systems.
In summary, Azure Notification Hubs are optimized for high-scale push notifications across multiple platforms, while Azure Service Bus provides a general-purpose messaging system with support for various protocols and features like message ordering and replay.
Hello dear developers, our company is starting a new project for a new Web App, and we are currently designing the Architecture (we will be using .NET Core). We want to embark on something new, so we are thinking about migrating from a monolithic perspective to a microservices perspective. We wish to containerize those microservices and make them independent from each other. Is it the best way for microservices to communicate with each other via ESB, or is there a new way of doing this? Maybe complementing with an API Gateway? Can you recommend something else different than the two tools I provided?
We want something good for Cost/Benefit; performance should be high too (but not the primary constraint).
Thank you very much in advance :)
There are many different messaging frameworks available for IPC use. It's not really a question of how "new" the technology is, but what you need it to do. Azure Service Bus can be a great service to use, but it can also take a lot of effort to administrate and maintain that can make it costly to use unless you need the more advanced features it offers for routing, sequencing, delivery, etc. I would recommend checking out this link to get a basic idea of different messaging architectures. These only cover Azure services, but there are many other solutions that use similar architectural models.
https://docs.microsoft.com/en-us/azure/event-grid/compare-messaging-services
Pros of Azure Notification Hubs
Pros of Azure Service Bus
- Easy Integration with .Net4
- Cloud Native2
- Use while high messaging need1
Sign up to add or upvote prosMake informed product decisions
Cons of Azure Notification Hubs
Cons of Azure Service Bus
- Limited features in Basic tier1
- Skills can only be used in Azure - vendor lock-in1
- Lacking in JMS support1
- Observability of messages in the queue is lacking1