Azure Notification Hubs vs Azure Service Bus

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

Azure Notification Hubs

22
156
+ 1
0
Azure Service Bus

277
531
+ 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 · 442K 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
Manage your open source components, licenses, and vulnerabilities
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?
      Manage your open source components, licenses, and vulnerabilities
      Learn 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.
      Twilio
      Twilio offers developers a powerful API for phone services to make and receive phone calls, and send and receive text messages. Their product allows programmers to more easily integrate various communication methods into their software and programs.
      Twilio SendGrid
      Twilio SendGrid's cloud-based email infrastructure relieves businesses of the cost and complexity of maintaining custom email systems. Twilio SendGrid provides reliable delivery, scalability & real-time analytics along with flexible API's.
      Amazon SES
      Amazon SES eliminates the complexity and expense of building an in-house email solution or licensing, installing, and operating a third-party email service. The service integrates with other AWS services, making it easy to send emails from applications being hosted on services such as Amazon EC2.
      Mailgun
      Mailgun is a set of powerful APIs that allow you to send, receive, track and store email effortlessly.
      See all alternatives