SNS Topics and Fan-Out Architecture
Publish a message to one SNS topic and fan it out simultaneously to multiple SQS queues, Lambda functions, and HTTP endpoints.
What Is Amazon SNS?
Amazon Simple Notification Service (SNS) is a fully managed pub/sub messaging service. Publishers send messages to an SNS topic, and SNS immediately delivers those messages to all subscribers. Unlike SQS (pull-based), SNS is push-based—it delivers messages to subscribers as soon as they are published. This makes SNS ideal for broadcasting events to multiple downstream systems simultaneously.
SNS Topics: Standard and FIFO
Like SQS, SNS has two topic types: Standard topics offer best-effort message ordering, at-least-once delivery, and nearly unlimited throughput—they can deliver to SQS, Lambda, HTTP endpoints, email, SMS, and mobile push. FIFO topics guarantee strict ordering and exactly-once delivery to FIFO SQS subscribers only. FIFO topics support up to 3,000 messages per second with batching and are used when the order of events must be preserved across multiple subscribers.
aws sns create-topic --name 'OrderEvents'
# Create FIFO topic
aws sns create-topic \
--name 'OrderEvents.fifo' \
--attributes '{"FifoTopic": "true", "ContentBasedDeduplication": "true"}'All lessons in this course
- SQS Standard vs FIFO Queues
- Visibility Timeout, DLQ, and Long Polling
- SNS Topics and Fan-Out Architecture
- SQS Message Filtering and SNS + SQS Integration