Examples / AWS
How do you diagram SNS fan-out to Lambda and SQS?
Updated
SNS -> {Lambda Emailer, Lambda Analytics, SQS Archive} sends one event to all three consumers at once: the copies animate leaving together, which is the property that defines fan-out.
THE TEXT THAT DRAWS IT
SNS -> {Lambda Emailer, Lambda Analytics, SQS Archive}
Edit it in the box above and the diagram redraws as you type. Export it as an animated GIF, WebM or WebP, or a still PNG. Every format embeds this text, so the file can be read back into the editor.
WHAT IT SHOWS
Fan-out is the pattern that decouples a system. One publisher writes to an SNS topic and stops caring who reads it. Three subscribers each receive their own copy: a Lambda that sends email, another that records analytics, and an SQS queue that archives the raw event for replay.
The braces in the text are what make this a fan-out rather than a chain. Everything inside { } sits in the same column and receives the same message, which is exactly how SNS behaves: it does not round-robin, it delivers to every subscription.
This is the pattern where animation earns its keep. The three branches light up together, and that simultaneity is the whole architectural point. Drawn statically, a fan-out looks identical to a decision tree where only one path is taken; watching it removes that ambiguity.
Adding a fourth consumer means adding a name inside the braces. Nothing upstream changes, which is the property the pattern exists to give you.
QUESTIONS
- What is the difference between {A, B} and |A, B| in the DSL?
{A, B}is a broadcast: the message goes to every target at once.|A, B|is a choice: each pass the message goes to one target, alternating. Fan-out is a broadcast, so this page uses braces.- Why mix Lambda and SQS subscribers on one SNS topic?
- Lambda subscribers react immediately; an SQS subscriber buffers the same event for slower or batch processing. SNS delivers to both without either knowing about the other.
MORE AWS PATTERNS
Serverless REST API diagram
The request/response backbone of most serverless applications.
API Gateway -> Lambda -> DynamoDB
Queue worker diagram
Accept the request quickly, do the slow part somewhere else.
API Gateway -> Lambda -> SQS -> Lambda Worker -> DynamoDB
Event pipeline diagram
One event bus feeding both a processing chain and a raw archive.
EventBridge -> {(SQS -> Lambda -> DynamoDB), S3}
Also on this site: RAG pipeline diagram, Multi-agent router diagram, ReAct tool-calling diagram, Human-in-the-loop diagram, MCP architecture diagram and Cloudflare Workers diagram. See all 10 patterns.
Chartado is a text-to-diagram tool: you type lines like A -> B, it draws the architecture and animates the flow.