ExitPublish-Subscribe Messaging: Topic-based fan-out1 / 9
Explanationassociate9 steps · 4 exercises

Publish once to a topic

How an Amazon SNS topic decouples a publisher from its recipients by distributing one published message to matching subscriptions without the publisher naming or calling each recipient.

When an order is created, inventory and shipping may both need to know about it. Instead of calling each recipient, the orders app sends one message to an Amazon SNS topic, a named destination for related messages. The app identifies the topic by its ARN, not by a list of recipients.

A subscription connects the topic to a delivery endpoint, such as an SQS queue or a Lambda function. SNS handles fan-out: it takes one published message and delivers a copy to each matching subscription.

Order created eventAll order eventsEU order events
Orders app on EC2Amazon EC2
Order events topicAmazon Simple Notification Service (Amazon SNS)
Inventory queueAmazon Simple Queue Service (Amazon SQS)
EU shipping functionAWS Lambda

Stage 1 of 5: The orders app creates an order and prepares an event that describes it.

Next up: Complete the diagram on what you just read.

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.