Event-driven architecture

A UML component diagram of an event-driven system: outbox, broker, schema registry, consumers, a read model and a dead letter queue.

By ArchynoEvent-drivenUpdated November 29, 2026Diagrams: 1Elements: 9Relationships: 8

Licensed under CC BY 4.0: reuse and change it, and credit Archyno

Created with Archyno

Use this template

It opens in the editor as an editable model. No account is needed to change and export it. A free account saves it. Keep the credit to the author.

Open and customize

When this architecture fits

Use it when one fact has many readers, when the readers change more often than the writer, or when work can happen a moment later. It is a poor choice when a user waits for the answer, because a chain of events has no single place that knows the result. Many systems use both: calls for questions and events for facts.

How an event travels

Every arrow on this diagram is a dependency. Note that no consumer depends on the order service. They depend on the broker and on the shape of the event.

  • The order service stores the order and its event in one transaction, in an outbox table.
  • The relay reads the outbox and publishes. If it stops, events wait, and none is lost.
  • The broker keeps the order per key, so two events of one order never swap.
  • A consumer that fails too often sends the event to the dead letter queue and goes on.

Change these parts first

Rename the services and the events. An event is a fact in the past: OrderPlaced, not PlaceOrder.

  • Choose the key. It decides what stays in order and what may run in parallel.
  • Write down who owns each schema and how a breaking change is made.
  • Decide how long the broker keeps events, and how a new consumer catches up.

Common mistakes

At-least-once delivery means every consumer sees a duplicate one day, so store the ids you have handled. Publishing after the database commit, without an outbox, loses events on a crash. And a dead letter queue that nobody watches is a slow way to lose data.

What is in this model

Dead letter queueComponent
Events that failed too often, for a person to check.
Event brokerComponent
Keeps each topic in order per key and delivers at least once.
Notification serviceComponent
Tells the customer. Has no other service behind it.
Order serviceComponent
Accepts an order and stores it together with its event.
Order viewComponent
A read model, built only from events, for fast screens.
Outbox relayComponent
Reads new events from the outbox table and sends them, so no event is lost.
Payment serviceComponent
Charges the order. Ignores an event it has seen before.
Schema registryComponent
Holds the version of each event's schema and refuses a breaking one.
Stock serviceComponent
Reserves items and publishes the result.