AWS SNS
AWS pub/sub messaging service that distributes messages to multiple subscribers simultaneously, enabling fan-out patterns and notifications at scale.
seed#aws#sns#messaging#pub-sub#notifications#serverless
What it is
Amazon SNS (Simple Notification Service) is a pub/sub messaging service that sends messages to multiple subscribers simultaneously. A publisher sends a message to a topic, and all subscribers receive it.
SNS vs SQS
| Aspect | SNS | SQS |
|---|---|---|
| Model | Pub/Sub (fan-out) | Queue (point-to-point) |
| Persistence | No (immediate push) | Yes (up to 14 days) |
| Consumers | Multiple | One per message |
| Typical use | Notifications, fan-out | Decoupling, buffering |
SNS + SQS pattern (Fan-out)
Producer → SNS Topic → SQS Queue A → Consumer A
→ SQS Queue B → Consumer B
→ Lambda → Processing
→ Email → Notification
Subscriber types
- Lambda, SQS, HTTP/HTTPS endpoints
- Email, SMS
- Kinesis Data Firehose
- Mobile push notifications
Why it matters
SNS is the glue of event-driven architectures in AWS. It enables decoupling producers from consumers with pub/sub, fan-out to multiple destinations, and delivery to SQS, Lambda, HTTP, and email. It is the piece that connects services without creating direct dependencies.
References
- SNS Documentation — Official documentation.
- SNS Message Filtering — AWS, 2024. Per-subscription message filtering.
- SNS Pricing — AWS, 2024. Pricing model.