SNS vs SQS vs EventBridge
Three messaging services that look alike. Here's when to use each.
1 min read
| Need | Use |
|---|---|
| One worker pool processes jobs at its own pace, with retries | SQS |
| Broadcast one message to many subscribers instantly | SNS |
| Route events by their content to many targets, react to AWS service events, or schedule tasks | EventBridge |
| Notify humans by email or SMS | SNS |
| Reliable fan-out to several processing pipelines | SNS → multiple SQS |
Quick heuristics
- "Do this work, eventually, exactly by one worker" → SQS.
- "This happened, tell everyone subscribed" → SNS.
- "This happened, route it by rules, including events from AWS services and SaaS apps" → EventBridge.
They combine well: EventBridge rule → SNS topic → SQS queues → Lambda is a perfectly normal architecture.
SNS best practices
- Encrypt topics with KMS when messages contain sensitive data.
- Set delivery retry policies for HTTP endpoints, and attach a DLQ (an SQS queue) to subscriptions.
- Lock down who can publish with topic access policies.
Key takeaways
- SQS for work queues, SNS for broadcast, EventBridge for content-based routing and AWS events.
- SNS → multiple SQS queues is the classic reliable fan-out.
- Encrypt sensitive topics and add DLQs to subscriptions.
Check your understanding
Pick an answer to see the explanation.
1. Whenever any EC2 instance in your account stops, you want to run a Lambda. Which service routes that best?
Next in “Make it production-ready”
You finished SNS. Continue with the EventBridge tutorial