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

1

7

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

Uruguay answered 23/4, 2014 at 7:47 Comment(4)
This seems like a question you should ask on the Amazon SNS forum, especially if you are interested in getting opinions from AWS staff.Maryrose
thanks Jeremy, posted forums.aws.amazon.com/thread.jspa?threadID=150836 , BTW, as the author of the AWS PHP SDK can you comment on the efficiency subject when using the SDK Guzzle based multi curl? or your SDK Execute command when dealing with such volume.. Apple claims 9000 devices/second is the low level performance expectance. can that be achieved via the AWS PHP SDK and SNS ?Uruguay
It's hard to say since it depends partly on your system's hardware and configuration. Network latency also affects the throughput. It would really be hard to say if it would work at the volume you desire without experimenting. Since each cURL handle requires a file descriptor on the underlying system, you need to make sure your system is configured to handle however many concurrent requests you want to do. You mentioned 20 above, 20 concurrent requests is not going to be a problem.Maryrose
@JeremyLindblom can you take a look at this question, seems like a PHP SDK bug...it wont let me pass validation no matter what... #23255905Uruguay
C
2

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.

Chalet answered 25/7, 2014 at 19:48 Comment(3)
the last point is a good one, but it is handicapped by the fact that you are limited to a handfull of these 10,000 strong lists... so you cant really count on it for broadcasting push messagesUruguay
A 10k reduction in the number of web service calls your application needs to send sounds like value to me. Not ideal, but it's still 10000x less work for your process.Chalet
the limit is no longer 10,000 - aws.amazon.com/sns/faqs/#limits-restrictions and also, you still need to manage the APNS feedback service if you do it yourself - AWS handles this for you. you can also get your service limits increased, and worst case, you can manage multiple accounts in your software and increase you topic limit that way, it just requires using the right access keys. and finally, i would save your limit SNS topics for channels with really large subscription bases - the ones with less than 1000 or something i would send direct toMyrtamyrtaceous

© 2022 - 2024 — McMap. All rights reserved.