Azure Notification Hubs vs Azure Service Bus

Need advice about which tool to choose?Ask the StackShare community!

Azure Notification Hubs

20
154
+ 1
0
Azure Service Bus

549
525
+ 1
7
Add tool

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.

Advice on Azure Notification Hubs and Azure Service Bus
André Almeida
Technology Manager at GS1 Portugal - Codipor · | 5 upvotes · 406.9K views
Needs advice
on
Azure Service BusAzure Service Bus
and
RabbitMQRabbitMQ

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 :)

See more
Replies (2)

A Pro of Azure Service Bus is reliability and persistence: you can send message when receiver is offline; receiver can read it when it back online. A Cons is costs and message size. You can consider also SignalR

See more
Recommends

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

See more
Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of Azure Notification Hubs
Pros of Azure Service Bus
    Be the first to leave a pro
    • 4
      Easy Integration with .Net
    • 2
      Cloud Native
    • 1
      Use while high messaging need

    Sign up to add or upvote prosMake informed product decisions

    Cons of Azure Notification Hubs
    Cons of Azure Service Bus
      Be the first to leave a con
      • 1
        Limited features in Basic tier
      • 1
        Skills can only be used in Azure - vendor lock-in
      • 1
        Lacking in JMS support
      • 1
        Observability of messages in the queue is lacking

      Sign up to add or upvote consMake informed product decisions

      What is Azure Notification Hubs?

      Tutorials, API references, and other documentation show you how to set up and send push notifications from any backend to any mobile device

      What is Azure Service Bus?

      It is a cloud messaging system for connecting apps and devices across public and private clouds. You can depend on it when you need highly-reliable cloud messaging service between applications and services, even when one or more is offline.

      Need advice about which tool to choose?Ask the StackShare community!

      What companies use Azure Notification Hubs?
      What companies use Azure Service Bus?
      See which teams inside your own company are using Azure Notification Hubs or Azure Service Bus.
      Sign up for StackShare EnterpriseLearn More

      Sign up to get full access to all the companiesMake informed product decisions

      What tools integrate with Azure Notification Hubs?
      What tools integrate with Azure Service Bus?

      Sign up to get full access to all the tool integrationsMake informed product decisions

      What are some alternatives to Azure Notification Hubs and Azure Service Bus?
      Firebase
      Firebase is a cloud service designed to power real-time, collaborative applications. Simply add the Firebase library to your application to gain access to a shared data structure; any changes you make to that data are automatically synchronized with the Firebase cloud and with other clients within milliseconds.
      Amazon SNS
      Amazon Simple Notification Service makes it simple and cost-effective to push to mobile devices such as iPhone, iPad, Android, Kindle Fire, and internet connected smart devices, as well as pushing to other distributed services. Besides pushing cloud notifications directly to mobile devices, SNS can also deliver notifications by SMS text message or email, to Simple Queue Service (SQS) queues, or to any HTTP endpoint.
      OneSignal
      OneSignal is a high volume push notification service for websites and mobile applications. OneSignal supports all major native and mobile platforms by providing dedicated SDKs for each platform, a RESTful server API, and a dashboard.
      OneSignal
      OneSignal is a high volume push notification service for websites and mobile applications. OneSignal supports all major native and mobile platforms by providing dedicated SDKs for each platform, a RESTful server API, and a dashboard.
      Firebase Cloud Messaging
      It is a cross-platform messaging solution that lets you reliably deliver messages at no cost. You can notify a client app that new email or other data is available to sync. You can send notification messages to drive user re-engagement and retention. For use cases such as instant messaging, a message can transfer a payload of up to 4KB to a client app.
      See all alternatives