Event-driven architecture
Services announce what happened; others react, without knowing who sent it.

In an event-driven architecture, components communicate by publishing events: facts about something that happened, such as OrderPlaced. A broker delivers each event to every component that subscribed to it. The producer does not know or wait for the consumers, so you can add a new reaction without touching the code that raised the event.
Brokers range from queues and pub/sub services (RabbitMQ, Amazon SNS and SQS, Google Pub/Sub) to durable logs (Apache Kafka, Amazon Kinesis) that keep events so consumers can replay them.
The parts of the pattern
- Producers
- Publish an event when their state changes. They do not call the consumers.
- Event broker
- Stores and delivers events by topic, with retries and ordering guarantees that depend on the product.
- Consumers
- Subscribe to the events they care about and react at their own pace.
- Dead-letter topic
- Holds events a consumer failed to process after retries, for inspection and replay.
- Event contracts
- The event names and schemas, often kept in a schema registry so producers and consumers agree.
How it works
- Checkout commits an order and publishes OrderPlaced to the broker.
- The email, shipping and analytics services each receive their own copy.
- Each consumer processes it independently; a slow analytics job does not delay shipping.
- If shipping keeps failing on one event, the broker moves it to the dead-letter topic.
When to use it, and when not to
Good fit
- Several parts of the system must react to the same business events.
- You want to add new behaviour without changing the producers.
- Absorbing bursts of traffic and smoothing load with a buffer.
- Integrating independently deployed services or teams.
Think twice
- The caller needs an immediate answer from the other side: use a request and response call.
- A small system where the flow is simpler to follow as direct calls.
- You cannot handle duplicates and out-of-order delivery: consumers must be idempotent.
Edit this diagram
Click Open the diagram in the editor to get your own copy, saved in your browser. Rename the boxes to match your system, swap the generic boxes for technology icons from the palette, then export a PNG, SVG or PDF, or share a link. No sign-up.