What is AWS SNS? SNS vs Competitors
Published: 2024-03-12 16:01:25

Before diving into the comparison of PubNub and Amazon Simple Notification Service (SNS) for publish/subscribe messaging, it is useful to understand what each service is and what they offer. In this blog, we are not only set to explore the differences between these two technologies, but also integrate other powerful tools from Amazon Web Services, such as Kinesis and AWS Simple Queue Service (SQS) into the comparison.

In the realm of data delivery and message delivery, both PubNub and Amazon SNS, as well as the broader Amazon Web Services suite, are well-known names that utilize a publish/subscribe model or support a similar function like Kinesis. Though they share this core function, these services offer different features and cater to distinct business needs. They are not replacements for each other but provide solutions to varied application requirements. By the end of this post, you will find that these technologies, including the use of an SNS topic and AWS SQS, serve very different use cases and applications.

What is PubNub?
---------------

[PubNub](https://www.pubnub.com/) is a real-time communication platform that offers APIs for developers to build real-time web, mobile, and IoT apps. It's designed to provide low latency messaging and updates, and it supports a variety of features including push notifications, presence, chat, and data synchronization among others.

It's used by over [2,000 organizations](https://www.pubnub.com/customers/) globally, including businesses, startups, and developers to build real-time apps quickly and easily. Whether it's in transportation, healthcare, social media, or e-commerce, PubNub powers real-time communication across industries.

What is AWS SNS?
----------------

AWS Simple Notification Service (SNS) is a messaging service offered by Amazon Web Services that enables developers to send push notifications, SMS, and emails to end-users and other applications. When used with other AWS tools like Kinesis and SQS, it offers flexible options for handling data streams and message queues.

### What is SNS used for?

AWS SNS has numerous applications, with some popular ones being:

-   Mobile Push Notifications: AWS SNS provides a unified way to send push notifications to Android's Firebase cloud messaging and iOS APNS push messaging systems. It simplifies the process to a single endpoint. [PubNub's Push Notifications](https://www.pubnub.com/products/pubnub-platform/#pushnotifications) offer similar functionality.
    
-   Email or SMS notifications: This feature allows the sending of emails or SMS messages to subscribers, such as customers or administrators, when events occur. For instance, retailers can notify customers via an SMS or email when their orders are confirmed.
    
-   Application-to-application messaging: AWS SNS can facilitate message communication between applications within a distributed system in a 1:1 or 1:many pattern, much like Kinesis and AWS SQS. This is akin to [PubNub's Pub/Sub messaging system](https://www.pubnub.com/products/pubnub-platform/#pubsub)
    

### SNS latency

It is difficult to quantify the latency of AWS SNS since it can depend on a number of factors such as the region, size of the message and the number of subscribers. SNS is advertised to as low-latency which will deliver messages as quickly as possible

### SNS pricing and costs

Up to date figures for SNS pricing can be found at the [AWS SNS pricing page](https://aws.amazon.com/sns/pricing/). The price will differ depending on the type of message being sent and a free tier is available.

Publishing to end-user devices: PubNub vs Amazon SNS
----------------------------------------------------

PubNub is explicitly designed to deliver data with low latencies (under 0.25 seconds SLA) to end-user devices, including smartphones, tablets, browsers, and laptops. These devices can be behind firewalls, NAT environments, cell towers authorities, and other hard-to-reach network environments; additionally PubNub is providing message caching for retransmission of lost signals over unreliable network environments. PubNub accomplishes this by maintaining an **always open socket connection** to every device, and using this open socket connection to ‘push’ data at low latencies. PubNub provides over [50 client SDK libraries](https://www.pubnub.com/docs/) to make it easy “plug into” PubNub with a simple **PubNub Subscribe API call**.Conversely, the main use for Amazon SNS is for server-to-server publish/subscribe use cases, or email & text message end-user notifications. To get a better idea of how Amazon SNS is implemented, check out the [common Amazon SNS use cases](https://www.quora.com/What-are-good-uses-of-Amazons-Simple-Notification-Service) here. Amazon SNS is also not optimized for in-app real-time notifications. Amazon SNS is more analogous to TIBCO or Tuxedo, which are server-to-server publish/subscribe systems.Amazon SNS has no way to reach client devices, except via email or SMS notifications. As a result, for applications that rely on low-latency data (such as multiplayer games, chat applications, collaborative apps, etc.) Amazon SNS is not the right solution in for this environment.The primary way that Amazon SNS sends data to subscribers is via email or

callbacks. Running an HTTP server on mobile, browser, and desktop devices to receive these notifications is impractical, both because of network firewalls and device security reasons.

Amazon SNS latency vs. PubNub
-----------------------------

Amazon SNS latency provides no guarantees, and the vast majority of latencies are measured over 1 second, and often many seconds slower. Again, this is somewhat irrelevant; Amazon SNS is designed for server-to-server (or email/SMS) notifications, where a latency of many seconds is often acceptable and expected.Because PubNub delivers data via an existing, established open network socket, latencies are under 0.25 seconds from publish to subscribe in the 95% percentile of the subscribed devices. Most humans perceive something as “real-time” if the event is perceived within 0.6 – 0.7 seconds.

### Channels/topics and Multiplexing PubNub and SNS

Amazon SNS allows for up to [100 “topics” to be created](https://aws.amazon.com/sns/?whats-new-cards.sort-by=item.additionalFields.postDateTime&whats-new-cards.sort-order=desc) on an account. A “topic” is equivalent to a PubNub channel. Conversely, PubNub supports an [unlimited number of PubNub channels](https://www.pubnub.com/docs/chat/overview). This allows every end-user device to have its own channel for one-to-one connectivity.

### SNS Multiplexing

Further, PubNub’s support for **Multiplexing** allows a client device to connect to multiple PubNub channels simultaneously, while continuing to use a single network socket. This allows for a client to simultaneously subscribe to, for example, a “private” channel specifically paired with a single device or set of devices owned by the same person, and a “public” channel that a group or entire population may also subscribed to.Another use-case for Multiplexing would be a [streaming stock price application](https://www.pubnub.com/solutions/data-streaming/): Assume you want to stream the stock price changes for 1,000 different equities. Each stock would have it’s own PubNub channel. The end-user device would use PubNub Multiplexing to subscribe only to the PubNub channels associated with the equities they want to track.

Since Amazon SNS does not support Multiplexing, this type of use case is not possible.

SNS reliability and redundancy vs PubNub
----------------------------------------

PubNub is globally distributed in 14 data centers and growing. All data published into the PubNub Global Cloud is automatically replicated globally, providing both low latency worldwide, as well as unparalleled reliability, even in the event of entire data center failures. PubNub offers up to 99.999% SLA uptime for its Data Stream Network.

PubNub vs AWS SNS features
--------------------------

Beyond simple publish/subscribe, PubNub offers a collection of [real-time building block services](https://www.pubnub.com/products/pubnub-platform/) for any kind of real-time application. These services are not offered by Amazon SNS or other Amazon services:

-   [Data Sync](https://www.pubnub.com/products/pubnub-platform/) — Automatically syncs application data in real time across devices and stores and shares objects throughout an applications lifecycle.
    
-   [Presence](https://www.pubnub.com/products/presence/) — Provides real-time updates for which users are online, and alerts for when they go off-line. These updates are provided via a multiplexed PubNub “sister-channel” that streams presence updates whenever the user count within an app changes. An additional API called “Here\_Now()” also provides an up-to-the-second count for users in the app.
    
-   [Storage & Playback](https://www.pubnub.com/products/pubnub-platform/) — PubNub automatically stores all data published to each channel, and provides two mechanisms for retrieving this data: (a) a simple REST request to retrieve the data all at once, and (b) a playback mechanism for “playing back” this data similar to a DVR for TV recordings.
    
-   [Real-time Analytics](https://www.pubnub.com/products/pubnub-platform/) — PubNub provides various visualizations and usage statistics to display user activity, geography, and usage. An example screenshot is below
    
-   [Offline Mobile Push](https://www.pubnub.com/products/pubnub-platform/) — PubNub also provides a fallback mechanism for messages to mobile devices for when the mobile app is not running (or in the background). PubNub can fall back to a mobile “push notification”, ensuring the mobile end-user is notified even when the phone is in their pocket. As soon as the app is launched, the app will begin using the data stream network again.
    

![](https://www.pubnub.com/cdn/3prze68gbwl1/asset-17suaysk1qa1k9r/c3f67d414fae694db584c813ac0787f9/Screen-Shot-2014-08-13-at-9.16.55-AM.png)

-   [AES Encryption](https://www.pubnub.com/products/security-overview/) — PubNub provides out-of-the-box AES 256 encryption support, ensuring that data remains encrypted while routing through the PubNub network. While Amazon SNS provides HTTPS, this means that the data is _unencrypted_ while routing through the Amazon network. This immediately invalidates Amazon SNS’s use for HIPAA, SAS70, and other security-minded applications.
    
-   [Multiplexing](https://www.pubnub.com/products/pubnub-platform/) — PubNub enhances multi-channel communication with a mechanism that allows all data topics to be streamed over a single
    

Socket Connection. With PubNub Multiplexing the savings are most apparent with mobile device resources such as phones on battery and slower network connectivity. Data is compressed and bundled via configurable windowing to provide longer battery life and improved end-user experience under continuously changing network conditions.

When to choose PubNub, SNS, or AWS Kinesis?
-------------------------------------------

Amazon SNS presents a variety of interesting uses, mostly centring on server-to-server notifications and email/SMS end-user alerts, known as SNS topics. It was initially developed as a way to orchestrate data between various other Amazon AWS cloud services, thereby primarily used for server back-end operations and data movement. On the other hand, AWS Kinesis is often chosen for real-time data streaming and analytics.

In contrast, PubNub focuses on enabling developers to build real-time applications that can serve large numbers of users simultaneously. This difference sets PubNub apart, making it particularly suited to applications that require robust, efficient real-time functionality, and a seamless message delivery system.

How can PubNub help you?
------------------------

Our platform helps developers build, deliver, and manage real-time interactivity for web apps, mobile apps, and IoT devices.

The foundation of our platform is the industry's largest and most scalable real-time edge messaging network. With over [19 points-of-presence worldwide](https://www.pubnub.com/platform/global-infrastructure/) supporting 1 billion monthly active users, and 99.999% reliability, you'll never have to worry about outages, concurrency limits, or any latency issues caused by traffic spikes.

Experience PubNub
-----------------

Check out the [Live Tour](https://www.pubnub.com/tour/introduction/) to understand the essential concepts behind every PubNub-powered app in less than 5 minutes.

Get Setup
---------

Sign up for a [PubNub account](https://admin.pubnub.com/signup/) for immediate access to PubNub keys for free.

Get Started
-----------

The [PubNub docs](https://www.pubnub.com/docs) and [SDKs](https://www.pubnub.com/docs) will get you up and running, regardless of your use case. Our comprehensive and up-to-date documentation provides clear instructions and helpful examples to ensure a smooth start to your development process.

#### Contents

[What is PubNub?](#h-0)[What is AWS SNS?](#h-1)[What is SNS used for?](#h-2)[SNS latency](#h-3)[SNS pricing and costs](#h-4)[Publishing to end-user devices: PubNub vs Amazon SNS](#h-5)[Amazon SNS latency vs. PubNub](#h-6)[Channels/topics and Multiplexing PubNub and SNS](#h-7)[SNS Multiplexing](#h-8)[SNS reliability and redundancy vs PubNub](#h-9)[PubNub vs AWS SNS features](#h-10)[When to choose PubNub, SNS, or AWS Kinesis?](#h-11)[How can PubNub help you?](#h-12)[Experience PubNub](#h-13)[Get Setup](#h-14)[Get Started](#h-15)

How can PubNub help you?
========================

This article was originally published on [PubNub.com](https://www.pubnub.com/blog/amazon-sns-pubnub-differences-pubsub/)

Our platform helps developers build, deliver, and manage real-time interactivity for web apps, mobile apps, and IoT devices.

The foundation of our platform is the industry's largest and most scalable real-time edge messaging network. With over 15 points-of-presence worldwide supporting 800 million monthly active users, and 99.999% reliability, you'll never have to worry about outages, concurrency limits, or any latency issues caused by traffic spikes.

Experience PubNub
-----------------

Check out [Live Tour](https://www.pubnub.com/tour/introduction/) to understand the essential concepts behind every PubNub-powered app in less than 5 minutes

Get Setup
---------

Sign up for a [PubNub account](https://admin.pubnub.com/signup/) for immediate access to PubNub keys for free

Get Started
-----------

The [PubNub docs](https://www.pubnub.com/docs) will get you up and running, regardless of your use case or [SDK](https://www.pubnub.com/docs)