Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Benefits of using AWS SNS vs directly working with Apple's APNS

I have an app logic that requires me to segment user devices to groups which are subscribed to different types of "channels/topics".

I then want to send a broadcast message to all the subscribers of a specific topic or channel.

I can have as many as 500,000 topics or channels, and as many as 20,000 subscribers per channel.

since AWS SNS has a limit of 3,000 topics and 10,000 subscribers per channel their FAQ suggest you use direct addressing, meaning send one-by-one by myself. they suggest we also go this route if we have high volume..

AWS SNS has no batch publish function so I actually need to make one SNS publish request per subscriber, this can mount to tens of thousands requests..

So I found out that AWS-PHP-SDK is built on top of Guzzle and supports parallel request processing via multi curl, but even so, if I run 20 connections at the same time I still need to make so many requests... is that even efficient? why would that be the recommended way to go if I have large volumes?

and another question comes to mind, if I need to send the same message to each subscriber by itself, one by one, why use SNS at all?

Apple APNS service works by opening a TCP connection and writing bytes of requests, each with a different subscriber details, but I can just write the bytes without the overhead of building PHP requests and dealing with 20 processes. wouldn't that be much faster way of getting my message to all of the topic/channel subscribers?

I am a bit confused about the tradeoff and the added value of AWS SNS service in these type of cases. I would appreciate some insight from someone with past experience with this or from AWS staff.

thank you

like image 573
Moshe Marciano Avatar asked Apr 23 '14 07:04

Moshe Marciano


People also ask

Which AWS service is the best choice for publishing messages to subscribers?

Q: What is Amazon Simple Notification Service (Amazon SNS)? It provides developers with a highly scalable, flexible, and cost-effective capability to publish messages from an application and immediately deliver them to subscribers or other applications.

What is AWS SNS used for?

Amazon SNS enables you to send notifications directly to your customers. Amazon SNS supports SMS text messaging to over 200 countries, mobile push notifications to Amazon, Android, Apple, Baidu, and Microsoft devices, and also email notifications.

What is the difference between SNS and SQS?

Consumer TypeSQS : All the consumers are supposed to be identical and hence process the messages in exact same way. SNS : All the consumers are (supposed to be) processing the messages in different ways.

Does SNS support Web push?

In addition to sending direct push notification messages, you can also use Amazon SNS to send messages to mobile endpoints subscribed to a topic.


1 Answers

If you are just going to be doing 1-1 notifications to APNS targets, there isn't be much of an advantage to using SNS.

If you want to start targeting 1-1 notifications of iOS, Android, and other notification platforms, SNS becomes more useful since it helps you abstract all those different platform targets behind a single SNS API in your code.

If you want to broadcast 1-N, then SNS is also useful as you can make a single call to deliver to 10,000 devices.

like image 129
Aaron Davidson Avatar answered Oct 13 '22 02:10

Aaron Davidson