Pub/Sub Fan-Out diagram template

One publisher, one topic and many independent subscribers, each consuming at its own pace.

Pub/Sub Fan-Out architecture diagramOpen in ArchBoard

Builds a new scene in your browser. Your existing scenes are not touched.

About this design

Publish and subscribe decouples the service that knows something happened from every service that cares. The publisher writes an event such as an order was created to a topic and moves on; it neither knows nor waits for the consumers. Each subscriber, billing, shipping and notifications in this template, gets its own copy of every message and processes it at its own pace, so a slow consumer never delays the others. Adding a new subscriber needs no change to the publisher at all, which is the real benefit. The costs are indirect control flow that is harder to trace, and the need for consumers to cope with duplicates and ordering gaps. Use the diagram to talk about delivery guarantees, schema versioning of event payloads, dead letter handling, and how a team finds out who consumes its events.

Diagram as text

This is the source of the diagram, in the ArchBoard diagram DSL. Paste it into Tools, Diagram from text to rebuild or change it.

title "Pub/sub fan-out"
direction LR
service pub "Order service" -> topic sns "orders.created"
orders-created -> worker billing "Billing"
orders-created -> worker shipping "Shipping"
orders-created -> worker notify "Notifications"
orders-created -> worker analytics "Analytics"

Related guides

More messaging and events templates