What is advantage and disadvantage of using pubnub over Amazon Simple Notification Service (sns)? [closed]
Asked Answered
G

1

9

For my team project, I need to propose which one should we use PubNub or Amazon Simple Notification Service (SNS). I find PubNub very simple to implement and use but I could not find any thing concrete in Internet which says about there advantages and disadvantages over Amazon SNS.

Guimpe answered 30/12, 2013 at 16:37 Comment(0)
A
9

PubNub Real-Time Network and Amazon SNS

Original Answer Sourced from Quora: What are the advantages and disadvantages of using PubNub over Amazon SNS?

What are the advantages and disadvantages of using PubNub over Amazon SNS?

Both PubNub Real-Time Network and Amazon SNS use a Publish/Subscribe metaphor for sending and routing data. However, this is where the comparison ends. These two services provide different functionalities and solve different business problems; and one cannot replace the other.

Publishing to End-User Devices PubNub vs 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. 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 to make it easy “plug into” the PubNub Real-Time Network with a simple PubNub Subscribe API call.

Conversely, Amazon SNS has no way to reach client devices, except via email or SMS notifications. So, 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 HTTP 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. The primary use for Amazon SNS is for server-to-server publish/subscribe use cases, or email & text message end-user notifications. A good explanation of common Amazon SNS use cases is here: What are good uses of Amazon's Simple Notification Service?. Amazon SNS is not the correct tool for in-app real-time notifications. Amazon SNS is more analogous to Tibco or Tuxedo, which are server-to-server Publish/Subscribe systems.

Features PubNub Real-Time Network vs SNS

Beyond simple Publish/Subscribe, the PubNub Real-Time Network offers a collection of “building-block” services for any kind of real-time application. These services are not offered by Amazon SNS or other Amazon services:

  • PubNub 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.
  • PubNub Storage/Playback -- 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.
    PubNub Real-Time analytics -- PubNub provides various visualizations and usage statistics to display user activity, geography, and usage. An example screenshot is below:

PubNub Real-Time Network (RTN) Global Map Visual Data

  • PubNub Offline Mobile Push -- 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 PubNub’s Real-Time network again.
  • AES Encryption -- 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 HIIPA, SAS70, and other security-minded applications.
  • Multiplexing -- PubNub enhances multi-channel communication with a mechanism that allows all data topics to be streamed over a single TCP 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.

Latency (i.e. “Real-Time”) PubNub vs SNS

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. Amazon SNS provides no latency 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.

Channels/Topics and Multiplexing PubNub and SNS

Amazon SNS allows for up to 100 “topics” to be created on an account (see Amazon Simple Notification Service (SNS)). A “topic” is equivalent to a PubNub channel. Conversely, PubNub supports an unlimited number of PubNub channels. Some customers today routinely use over 1 million channels each month. This allows every end-user device to have its own channel for one-to-one connectivity.

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

Reliability and Redundancy PubNub Real-Time Network vs SNS

The PubNub Real-Time Network is globally distributed in 12 data centers and growing. All data published into the PubNub Global Cloud is automatically replicated globally, provides 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 it’s Real-Time Network. Amazon SNS is a beta offering, and as such, has no service level agreement.

Summary of PubNub Real-Time Network and SNS

Amazon SNS has a variety of interesting uses, mostly related to server-to-server notifications and email/SMS end-user alerts. It was originally developed as a way to orchestrate data between various other Amazon AWS cloud services, and thus is primarily used for server back-end operations and movement of data.

The PubNub Real-Time Network is designed to make it easy to build real-time apps on mobile, browser, and desktop that scale globally to millions of simultaneous users. Today PubNub is already in use across over 2,000 apps globally spanning social, advertising, gaming, telecommunications, and a variety of other markets.

Addington answered 31/12, 2013 at 8:31 Comment(8)
This is not true: "Conversely, Amazon SNS has no way to reach client devices, except via email or SMS notifications". Amazon SNS added native message delivery via GCM and APNS about half a year ago.Coldiron
@Coldiron you make a good point thank you for the update. :-) We mention "Amazon SNS has no way to reach client devices..." and are referring to non-third party routes. Basically GCM and APNs are 3rd party vendors that front load the connectivity while SNS only calls these connections vendors from afar. Now that we are talking about GCM and APNS, it's really more of a conversation for Push Notifications which is a different type of solution and offered by other companies as well.Addington
SNS also can deliver to SQS or HTTP. HTTP won't work for mobile devices, but with delivery to SQS and an application long-polling SQS you can achieve most of the things you are talking about.Coldiron
Obviously you are being up-front about who you are, but what you write about SNS in general is stretching the truth in some cases. Although your assertion that SNS is designed for server-to-server communication is true, and you are right that these use cases might not be the easiest or best on SNS. Here are some corrections: 1) Multiplexing - the use cases you mentioned can easily be achieved by using a combination of SNS and SQS with the client long polling SQS.Coldiron
2) 100 topics - You can easily request an increase in the number of topics here: aws.amazon.com/contact-us/…Coldiron
3) Latencies - I don't know where you got the numbers for SNS, but they are certainly not what I have experienced. This might be true for email and SMS messages, but for http and SQS messages, 95th percentile latencies should be much better than that. Also, you are wrong to assume server-to-server applications are not latency sensitive.Coldiron
Good question regarding latencies and you make excellent points that I want to make sure we address in our conversation. SNS is setup as a region-by-region installation, it isn't Global multi-data center automatically; I know you can achieve this somehow with some effort. Comparatively PubNub is a Real-Time Network which is global with 14 data centers today and more to come with automatic replication for global availability and maximum performance. Check out the global latency measurements for send+receive round trip: uptime.pubnub.com/302344Addington
Yes, that is true. I don't mean to disparage the pubnub service in any way. It looks to me superior in a lot of ways if you are looking for real-time messaging to applications running on user devices (phones, PCs, etc.)Coldiron

© 2022 - 2024 — McMap. All rights reserved.