Amazon EventBridge, Amazon SQS, and Amazon SNS all move messages between parts of a system, and all integrate natively with AWS Lambda. They are not interchangeable. Choosing the right one — and combining them — is the core of a reliable event-driven architecture on AWS.
One-line summaries
- SQS is a queue: messages wait until a consumer pulls and deletes them. One logical consumer per queue. Buffering, retries, and back-pressure.
- SNS is pub/sub fan-out: a message published to a topic is pushed to every subscriber. Simple, fast, high-throughput broadcasting.
- EventBridge is an event bus with routing: events are matched against rules by their content and delivered to targets. Many event types, many consumers, schema-aware, with archive and replay.
Amazon SQS: decouple and buffer
Use SQS when a producer should not wait for, or be affected by, the consumer.
- Standard queues offer very high throughput with at-least-once delivery and best-effort ordering.
- FIFO queues preserve order within a message group and deduplicate messages within a five-minute window, at lower throughput.
- Messages stay until processed or until the retention period (up to 14 days) expires.
- The visibility timeout hides a message while it is being processed; if the consumer fails, it reappears for retry.
- A dead-letter queue (redrive policy) catches messages that fail repeatedly.
With Lambda as the consumer, the event source mapping polls the queue, invokes the function with batches, and scales concurrency with queue depth. Set maximum concurrency on the event source to protect fragile downstream systems, and return partial batch failures so only failed messages are retried.
Amazon SNS: broadcast to many
Use SNS when one message must reach several subscribers immediately.
- Subscribers can be SQS queues, Lambda functions, HTTP endpoints, email, SMS, or mobile push.
- Subscription filter policies let each subscriber receive only the messages it cares about, based on message attributes or body.
- FIFO topics combined with FIFO queues give ordered fan-out.
The most common production pattern is SNS → SQS fan-out: each consumer gets its own queue subscribed to the topic, so each one buffers, retries, and fails independently.
Amazon EventBridge: route events by content
Use EventBridge when you have many event types, many producers and consumers, and want routing decided by the event's content rather than by which topic it was sent to.
- Events are JSON with a standard envelope (
source,detail-type,detail). Rules match patterns on any field — including prefixes, numeric ranges, andanything-but— and send matching events to up to five targets each. - Targets include Lambda, SQS, SNS, Step Functions, Kinesis, API Gateway, other event buses (including in other accounts), and arbitrary HTTP endpoints through API destinations.
- Archive and replay let you re-send past events — invaluable after a consumer bug.
- The schema registry can discover event shapes and generate code bindings.
- AWS services and many SaaS partners publish events directly to EventBridge.
- Related features: EventBridge Pipes connects a source (SQS, Kinesis, DynamoDB Streams) to a target with filtering and enrichment and no glue code; EventBridge Scheduler runs one-off and recurring schedules at scale.
EventBridge retries delivery to targets for up to 24 hours by default and supports a dead-letter queue per target. Its latency is typically higher than SNS's, which rarely matters for business events but can for very latency-sensitive fan-out.
Choosing: a quick guide
- "Process this work later, reliably, at my own pace" → SQS.
- "Tell several systems about this message right now" → SNS (usually into SQS queues).
- "Publish a business event; let any current or future consumer subscribe by content" → EventBridge (often into SQS queues).
- "Strictly ordered processing per key" → SQS FIFO (or Kinesis for high-volume streams).
- "Replay last week's events after fixing a bug" → EventBridge archive.
- "React to AWS service events or SaaS events" → EventBridge.
Patterns that combine them
Event bus → queue → function. EventBridge routes a business event to an SQS queue owned by the consuming service; a Lambda function processes the queue. The bus gives loose coupling and routing; the queue gives buffering, concurrency control, and retries under the consumer's control.
Topic → queues. For simple, high-throughput fan-out between a few known consumers, SNS into per-consumer SQS queues.
Pipes for integration. A DynamoDB Stream piped through EventBridge Pipes with a filter and enrichment step into an event bus turns database changes into domain events without a custom Lambda poller.
Delivery semantics you must design for
All three services can deliver a message more than once. Consumers with side effects — charging a card, sending an email, creating a record — must be idempotent. A common approach is to store an idempotency key (the event id or a business key) in DynamoDB with a conditional write and skip duplicates; AWS Lambda Powertools provides an Idempotency utility that implements this pattern.
Also design for out-of-order delivery unless you use FIFO. Include timestamps or version numbers in events so consumers can ignore stale updates.
Event design tips
- Name events in the past tense after business facts:
OrderPlaced, notCreateInvoice. - Include enough data for common consumers, but not entire database records.
- Version your schemas and keep changes backwards compatible.
- Document owners and consumers in an event catalog.
Summary
SQS buffers work, SNS broadcasts it, and EventBridge routes events by content across services and accounts. Most robust serverless systems use EventBridge or SNS for distribution and SQS in front of each consumer — with idempotent handlers everywhere.