Saturday, November 17, 2018

AWS for Developers and Application Architects - Part 4 - SQS and SNS

SNS(Simple Notification Service) : SNS is Amazon Simple Notification Service is fully managed push notification service that lets you send individual messages or to bulk 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.
A distributed publish-subscribe system. Messages are pushed to subscribers as and when they are sent by publishers to SNS ,SNS supports several end points such as sms, http end point, email and SQS. If you want unknown number and type of subscribers to receive messages, you need SNS.
With Amazon SNS, you can send push notifications to Apple, Google, Fire OS, and Windows devices , You can use SNS to send SMS messages to mobile device users in the US or to email recipients worldwide.
Amazon AWS SQS( Simple Queue Service) 
SQS is distributed queuing system. Messages are not pushed to receivers. Receivers have to poll SQS to receive messages. Messages can't be received by multiple receivers at the same time. Any one receiver can receive a message, process and delete it. Other receivers do not receive the same message later. Polling inherently introduces some latency in message delivery in SQS unlike SNS where messages are immediately pushed to subscribers.
SQS is mainly used to decouple applications or integrate applications. Messages can be stored in SQS for short duration of time (max 14 days). SNS distributes several copies of message to several subscribers. For example, lets say you want to replicate data generated by an application to several storage systems. You could use SNS and send this data to multiple subscribers, each replicating the messages it receives to different storage systems (s3, hard disk on your host, database, etc.).

No comments:

Post a Comment