Introduction to Amazon SNS
Pub/sub messaging that pushes messages to many subscribers.
- 1 lesson
- Module quiz
Some events interest several parts of a system at once. When an order is placed, billing, shipping and analytics may all need to know. Having the order service call each of them directly couples it to every consumer, and adding a new consumer means changing the order service.
Amazon Simple Notification Service (Amazon SNS) is a fully managed publish/subscribe service that solves this. A publisher sends a message to a topic, and SNS immediately pushes a copy to every subscriber of the topic, such as SQS queues, Lambda functions, HTTP endpoints, email addresses or mobile devices. Unlike SQS, SNS pushes messages rather than waiting for consumers to poll, and it does not store them for later collection. SNS is charged per million publish requests, plus a delivery charge that depends on the protocol.
Where SNS fits
SNS appears on the exam mainly in the fan-out pattern, in which a topic delivers each message to several SQS queues so that each consumer processes it independently, and in alerting, where CloudWatch alarms publish to topics. Subscription filter policies let each subscriber receive only the messages it needs. When the choice is between SNS and EventBridge, EventBridge suits content-based routing and events from AWS services and SaaS partners, while SNS suits high-throughput fan-out and notifications to people.
How this module is organised
The module has a single lesson, Fanning Out Messages with Amazon SNS Topics and Subscriptions, which explains subscribers and delivery, the fan-out pattern and the permissions it needs, and filter policies.