Link to home
Start Free TrialLog in
Avatar of cloudtechnician
cloudtechnician

asked on

What is the difference between Amazon SNS and Amazon SQS?

I've an AWS CSA Professional Level exam scheduled for 27th and someone told me that there will be lot of questions from SQS/SWF. I'm going through the AWS FAQs/Documentations and trying my level best to understand.

Although, to some extent I understood but I again get lost very soon in my head when I try to compare the difference and use case scenarios of these services. May be because I'm not from the developer background. :(

Could someone please help me in understanding, when one would use SNS versus SQS, and why are they always coupled together?
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

huge differences
Amazon Simple Notification Service (Amazon SNS) is a fast, flexible, fully managed push notification service that lets you send individual messages or to fan-out messages to large numbers of recipients. Amazon SNS makes it simple and cost effective to send push notifications to mobile device users, email recipients or even send messages to other distributed services.

With Amazon SNS, you can send notifications to Apple, Google, Fire OS, and Windows devices, as well as to Android devices in China with Baidu Cloud Push. You can use SNS to send SMS messages to mobile device users in the US or to email recipients worldwide.

Beyond these endpoints, Amazon SNS can also deliver messages to Amazon Simple Queue Service (SQS)
http://amzn.to/1ESsa20

Amazon Simple Queue Service (SQS) is a fast, reliable, scalable, fully managed message queuing service. SQS makes it simple and cost-effective to decouple the components of a cloud application. You can use SQS to transmit any volume of data, at any level of throughput, without losing messages or requiring other services to be always available.

With SQS, you can offload the administrative burden of operating and scaling a highly available messaging cluster, while paying a low price for only what you use.
http://amzn.to/1ESsdLt

what don't you understand?
Avatar of cloudtechnician
cloudtechnician

ASKER

Thanks David for the comment. I'm sorry, it was actually about the difference between SQS and SWF.
Basically, to implement something like push notification messages, it is recommended to use SNS messages and the SQS queues. Overall, just see them as the SNS messages are push into a SQS queue and stored until someone retrieve them from the queue, or takes them out of the queue (and delete) or the queue retention time expires. I tend to see it SNS analogous to the concept of Passenger/Passport and SQS is like the Travelator (moving walkway) queue (just that it is the static type when people move than it starts to move ...)..

Sort of an interim repository "safeguard" to ensure such message queuing scheme can be resilient for services not to lose message (unless reached queue size) and recover to the last message queued to be retrieved. The network tends to be full of unexpected capacity and for a better assurance this scheme may helps but can be slower since it is queue and retrieve approach as compared to "live" streaming (that easily flood the recipient) or push out broadcast that just send w/o user even been ready to take in or busy...

SNS/SQS both together will then function effectively and you can even have as many subscribers as you want for SNS. Then have notifications sent to multiple SQS queues. It scales up with more users and services. Do see the common scenario to aid understanding too...
http://docs.aws.amazon.com/sns/latest/dg/SNS_Scenarios.html

Also do not mix Apples APNS with AWS SNS/SQS. Most thought they are same but it is not. In fact you can use AWS SNS to push into APNS services (that acts like the "queue" in place of SQS). Overall, in order for SNS to communicate with the different push notification services, you submit your push notification service credentials to SNS to be used on your behalf.
http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html
ASKER CERTIFIED SOLUTION
Avatar of btan
btan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial