AWS · Comparison
SQS vs SNS vs EventBridge
Which service should move messages and events between parts of my application: a queue, a topic or an event bus?
Decision summary
Ask three questions.
- Should the message wait until a consumer is ready? Use SQS. It holds messages until they are processed and deleted.
- Should every subscriber get a copy right away? Use SNS (a topic). It pushes to each subscriber and holds nothing for a slow one.
- Should different targets get different events, chosen by what is inside each event, or should AWS service events and schedules trigger things? Use EventBridge.
They combine well: SNS or EventBridge fan out to several SQS queues, and each queue protects its own consumer.
Best fit for each option
SQS
Decoupling a producer from a consumer, smoothing spikes, retrying failed work with a dead-letter queue. One message is handled by one consumer.
SNS
Pushing one message to many subscribers at once (queues, functions, HTTP endpoints), and notifying people by email, SMS or mobile push.
EventBridge
Reacting to events from AWS services and SaaS partners, routing by event content with rules, schedules, and replaying archived events.
Side by side
| SQS | SNS | EventBridge | |
|---|---|---|---|
| Best for | Work queues and buffering between tiers | Fan-out and notifications | Event routing, AWS service events, schedules, SaaS integration |
| Scaling | Standard queues scale without a practical limit; scale the consumers | Very high publish rates and subscriber counts; per-account publish limits vary by Region | No capacity planning; per-Region publish and invocation throttles that can be raised |
| Performance | Pull model; long polling and batching of up to 10 messages | Push model; fast delivery with retries per protocol | Push model to targets; built for integration rather than lowest latency |
| Limits | 1 MiB message; 4-day default retention, up to 14 days | 256 KiB message by default, raised to 1 MiB; no storage for slow subscribers | A few targets per rule; per-Region PutEvents and invocation throttles |
| Security | Queue policies and IAM; SSE with SQS-managed or KMS keys | Topic policies and IAM; SSE with KMS; message data protection | Bus resource policies and IAM; per-target roles; optional KMS key on custom buses |
| Cost | Per request, with each 64 KB chunk billed as a request | Per publish and per delivery by endpoint type, in 64 KB chunks | Per million events published and delivered, plus optional features such as Pipes and replay |
| Availability | Messages stored across Availability Zones until deleted; dead-letter queues | Stored across Availability Zones, retried; dead-letter queue per subscription | Retried with backoff; dead-letter queue per target; archive and replay |
| Operational complexity | Tune visibility timeout, polling and batch size; make processing idempotent | Manage subscriptions and filter policies | Manage rules and event patterns; schema registry helps teams agree on events |
Scaling and topology
An SQS queue sits between one producer and one pool of consumers. An SNS topic sits between one publisher and many subscribers. An EventBridge bus sits between many producers and many targets, with rules choosing which events go where.
The most common production shape is fan-out to queues: the publisher sends once to SNS or EventBridge, which delivers into several SQS queues, and each downstream team's consumers read their own queue at their own pace.
Performance considerations
SQS consumers pull, so you control the rate. SNS and EventBridge push to targets, so a target has to keep up or fail and retry. This is the reason to put a queue between a push service and a consumer that is slow, bursty or sometimes down.
Limits and constraints
| Item | Value | Context | Source |
|---|---|---|---|
| SQS maximum message size | 1,048,576 bytes (1 MiB) | Source checked |
|
| SQS message retention | 1 minute to 14 days | The default is 4 days. | Source checked |
| SNS maximum message size | 262,144 bytes (256 KiB) by default | Can be raised to 1 MiB by setting the topic's MaximumMessageSize attribute. | Source checked |
| EventBridge targets per rule | 5 Fixed limit |
Classic event buses. | Source checked |
| EventBridge rules per event bus | 300 Can be raised with a quota request |
Source checked |
Quotas and limits change. Check the linked source before designing around a number.
Security implications
All three use IAM and resource policies to control who may publish, subscribe and receive, including across accounts, and all support encryption at rest and in transit. EventBridge adds a role for each target. For queues receiving from SNS or EventBridge, the queue's policy must allow the sender.
Cost trade-offs by scenario
| Scenario | What happens to cost |
|---|---|
| Steady background jobs, one consumer pool | SQS alone is usually the least expensive: you pay per request, and batching and long polling keep the count low. |
| One event for several consumers | SNS plus one SQS queue per consumer costs a publish plus a delivery and a request per queue; deliveries from SNS to SQS carry no per-message delivery charge. |
| Routing by content and reacting to AWS service events | EventBridge saves the code you would write; costs scale with events published and delivered, and AWS service events on the default bus are free to ingest. |
| Very large payloads | All three bill in 64 KB chunks, so send a reference to an S3 object instead of the data. |
Prices differ by Region and change over time; see the pricing pages linked under Sources.
Operational complexity
SQS is the simplest to reason about but needs idempotent consumers, because a message can be delivered more than once on standard queues. SNS needs thought about subscriber failure. EventBridge asks you to agree on an event shape across teams, which a schema registry supports.
When to avoid each option
SQS
- One message must reach many independent consumers: a queue gives each message to one.
- You need to replay history, since processed messages are deleted.
SNS
- A subscriber that is slow or offline and must not lose messages, unless an SQS queue sits between.
- Routing based on rich event content across many AWS services; EventBridge fits that better.
EventBridge
- Very high-throughput data streams or strict ordering: use Kinesis or MSK.
- Buffering for a slow consumer: add an SQS queue as the target.
Example scenarios
| Situation | Choose | Why |
|---|---|---|
| An order service hands payments to a worker pool that sometimes falls behind. | SQS | The queue buffers orders and a dead-letter queue catches failures. |
| A new order must be sent to billing, shipping and analytics at the same time. | SNS | One publish fans out to every subscriber; put a queue behind each for durability. |
| A security finding should open a ticket only if its severity is high, and everything should be archived. | EventBridge | A rule matches on severity and sends to different targets; an archive keeps events for replay. |
| Notify an operations team by email and text when an alarm fires. | SNS | SNS delivers to email and SMS directly. |
Exam cues
- Decouple and buffer: SQS. Fan-out / one to many: SNS (with SQS queues for durability).
- React to AWS service events, schedule jobs, content-based routing, SaaS events: EventBridge.
- Ordering: SQS FIFO (and SNS FIFO topics). Duplicates possible on standard queues: make consumers idempotent.
- Streaming with replay and multiple readers of the same ordered data: Kinesis or MSK, not these three.
Service pages
- Amazon SQS · A fully managed message queue that decouples producers from consumers, so work is buffered and processed at the consumer's pace.
- Amazon SNS · A managed publish/subscribe service that pushes each message to many subscribers: queues, functions, HTTP endpoints, email and SMS.
- Amazon EventBridge · A serverless event bus that routes events from AWS services, your apps and SaaS partners to targets using rules that match event content.
Related
Courses and lessons
- Amazon SQS: queues, FIFO, visibility timeout and dead-letter queues · AWS Solutions Architect – Associate (SAA-C03) · Members
- Amazon SNS and the fan-out pattern · AWS Solutions Architect – Associate (SAA-C03) · Members
- Amazon EventBridge: event buses, rules, Scheduler and Pipes · AWS Solutions Architect – Associate (SAA-C03) · Members
- Amazon MQ, AppFlow and choosing an integration service · AWS Solutions Architect – Associate (SAA-C03) · Members
Services, comparisons and patterns
- Amazon SQS · Service
- Amazon SNS · Service
- Amazon EventBridge · Service
- Amazon Kinesis · Service
- Amazon Managed Streaming for Apache Kafka (Amazon MSK) · Service
- AWS Step Functions · Service
- Event-driven order processing · Solution pattern
Sources
Independent study material, not affiliated with or endorsed by Amazon Web Services.