How it works
The SNS and SQS fan-out pattern uses one SNS topic to distribute events to multiple subscribed SQS queues. Each queue serves a separate processing group, allowing groups to read and process asynchronously at their own pace. Subscription filters can limit which messages are delivered; applications must still handle failures and possible duplicate delivery.
When to use it
Several services must each process every event, with persistence and retries, and new consumers may appear later.
Real-world example
A video platform publishes a new upload event to SNS. Separate SQS queues for thumbnail generation, copyright checking, and metadata indexing receive eligible copies, which their workers then process independently.
Key facts
- The SQS access policy must allow SNS to write.
- Works with queues in other Regions.
- SNS FIFO + SQS FIFO adds ordering and deduplication.
Common pitfall
Forgetting to configure the SQS access policy to allow SNS to send sqs:SendMessage can cause delivery to fail. Restrict the permission to the appropriate topic and monitor delivery failures to detect problems.
Often confused with
A shared SQS queue distributes work among consumers, with possible duplicate delivery.
References
Prepared by Cloud Quest. Check current behavior and limits in the AWS documentation:
Keywords you will see in SAA-C03 questions
- same event to many queues
- S3 events to multiple queues
- no data loss
Understand it for real with 3D models and simulated labs
Connect the concept to a working architecture.