Introduction

Amazon Simple Queue Service, Amazon Simple Notification Service, and Amazon EventBridge are three services that move messages and events between the parts of a system. They are commonly confused because their purposes overlap. This guide compares the three and explains when each should be used. The broader pattern of connecting components through events is covered in the guide on event-driven architecture.

What is being compared?

Amazon SQS is a queue, which is a buffer that holds messages until a consumer is ready to process them. Amazon SNS is a publish-subscribe service, in which a message that is published to a topic is delivered to every subscriber. A topic is a channel to which subscribers are attached. Amazon EventBridge is an event bus, which receives events and routes each one to the targets that its rules match.

Why the choice matters

Each service solves a different problem. Using a queue where broadcasting is required, or a broadcast where routing is required, leads to awkward designs. Understanding whether the need is to buffer work, to deliver to many consumers, or to route by content allows the correct service to be selected.

How each works

In SQS, a producer sends a message to a queue. The message is held until a consumer retrieves it, processes it, and deletes it. Only one consumer processes each message, which makes SQS suited to distributing work and absorbing bursts.

In SNS, a publisher sends a message to a topic, and SNS delivers a copy to every subscriber at once. This is the fan-out pattern, in which one message reaches many consumers.

In EventBridge, a producer sends an event to a bus. The bus evaluates its rules, which can match on the content of the event, and delivers the event to each matching target. EventBridge also receives events from many AWS services and can trigger targets on a schedule.

Comparison diagram

SQS (queue) SNS (publish-subscribe) EventBridge (routing) producer publisher producer | | | v v v [ queue ] [ topic ] [ event bus + rules ] | / | \ / | \ v v v v v v v one consumer many subscribers targets matched by pulls each each get a copy rule on event content message

Where each is strongest

Limitations to consider

When to choose each

Best practices

Common mistakes

Further reading in this library

Frequently Asked Questions

What is the core difference between SQS, SNS, and EventBridge?
SQS is a queue that holds messages until a consumer processes them. SNS delivers a message to many subscribers at once. EventBridge routes events to targets according to rules. One buffers, one broadcasts, and one routes.
When should SQS be used?
To decouple a producer from a consumer and to absorb bursts of work. Messages are held until a consumer is ready, which prevents the consumer from being overwhelmed.
When should SNS be used?
To deliver the same message to many subscribers at once, a pattern known as fan-out. Each subscriber receives its own copy.
When should EventBridge be used?
When events must be routed to different targets based on their content, when integrating with many AWS services, or when scheduling actions.
Can they be combined?
Yes. A common pattern places an SQS queue as a subscriber of an SNS topic, so that a broadcast message is buffered for each consumer. EventBridge can also deliver events into a queue.
AWS Serverless Architecture Handbook cover
Go deeper ยท Book as a Service™
AWS Serverless Architecture Handbook

This article is the summary. The book is the full, continuously updated reference: messaging patterns, fan-out, routing, error handling, and complete serverless architectures.

View the book