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.

  1. Should the message wait until a consumer is ready? Use SQS. It holds messages until they are processed and deleted.
  2. Should every subscriber get a copy right away? Use SNS (a topic). It pushes to each subscriber and holds nothing for a slow one.
  3. 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

 SQSSNSEventBridge
Best forWork queues and buffering between tiersFan-out and notificationsEvent routing, AWS service events, schedules, SaaS integration
ScalingStandard queues scale without a practical limit; scale the consumersVery high publish rates and subscriber counts; per-account publish limits vary by RegionNo capacity planning; per-Region publish and invocation throttles that can be raised
PerformancePull model; long polling and batching of up to 10 messagesPush model; fast delivery with retries per protocolPush model to targets; built for integration rather than lowest latency
Limits1 MiB message; 4-day default retention, up to 14 days256 KiB message by default, raised to 1 MiB; no storage for slow subscribersA few targets per rule; per-Region PutEvents and invocation throttles
SecurityQueue policies and IAM; SSE with SQS-managed or KMS keysTopic policies and IAM; SSE with KMS; message data protectionBus resource policies and IAM; per-target roles; optional KMS key on custom buses
CostPer request, with each 64 KB chunk billed as a requestPer publish and per delivery by endpoint type, in 64 KB chunksPer million events published and delivered, plus optional features such as Pipes and replay
AvailabilityMessages stored across Availability Zones until deleted; dead-letter queuesStored across Availability Zones, retried; dead-letter queue per subscriptionRetried with backoff; dead-letter queue per target; archive and replay
Operational complexityTune visibility timeout, polling and batch size; make processing idempotentManage subscriptions and filter policiesManage rules and event patterns; schema registry helps teams agree on events

Scaling and topology

Order servicepublishes onceSNS topicordersSQS: billingall ordersSQS: shippingall ordersSQS: fraudfilter: amount > 1000Lambda: emailfilter: country = DE
Fan-out: one SNS publish delivers a copy to every subscribed queue; filter policies choose who gets what

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

ItemValueContextSource
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

ScenarioWhat happens to cost
Steady background jobs, one consumer poolSQS alone is usually the least expensive: you pay per request, and batching and long polling keep the count low.
One event for several consumersSNS 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 eventsEventBridge 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 payloadsAll 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

SituationChooseWhy
An order service hands payments to a worker pool that sometimes falls behind.SQSThe 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.SNSOne 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.EventBridgeA 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.SNSSNS 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

Related

Courses and lessons

Services, comparisons and patterns

Sources

Independent study material, not affiliated with or endorsed by Amazon Web Services.

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake