AWS Simple Notification Service (SNS)
- SNS is highly scalable push based messaging system (unlike SQS which is pull based).
- Works on the principle of pub/sub (publish subscribe) protocol
- Publishers send messages to SNS topic
- One or more subscribers (programs/lambdas/EC2’s) can subscribe to the topic.
- Once subscribed to a topic, all subscriber programs get all the messages PUSHED to it.
- No need to poll for the messages unlike the SQS
- Push notifications can be sent in many ways:
- Push messages to Android/ios/fire os devices
- SMS text messages
- Emails
- SQS queues
- HTTP REST endpoints
- SNS achieves redundancy by storing these messages across many Availability Zones in a single region.
- Protocols used: HTTP, HTTPS, EMAIL, EMAIL-JSON, SQS or Application – messages can be customized for each protocol.
- SNS messages are stored redundantly to multiple AZs
- Data format used by SNS is JSON (Subject, Message, TopicArn, MessageId, unsubscribeURL)
- Cost is based on recipient types.
- $0.50 per 1 million SNS requests
- to HTTP: $0.06 / 100,000 notification deliveries
- to EMAIL: $2 / 100,000 notification deliveries
- to SMS: $0.75 / 100 notification deliveries