Parts of the system react to events instead of calling each other directly.
Event-driven architecture (EDA) is a way to build systems where parts talk by sending events: short messages that say "this just happened". Other parts react when they care.
In a request-driven design, one service calls another and waits: "Charge this card. Reduce the stock. Send the email." The caller must know every service, and if one is down, the whole call fails.
In an event-driven design, the order service only records that an order was placed and publishes an event. It does not ask anyone to do anything. The payment, stock, email and analytics services each subscribe to that event and do their own job in their own time.
An event is a fact about the past (named in the past tense: OrderPlaced, PaymentFailed). It is different from a command ("ChargeCard"), which asks one specific service to do something. Events are broadcast; commands are directed.
| Style | What the event carries | Example |
|---|---|---|
| Event notification | Only a small signal: what happened and an ID. The consumer fetches details if needed. | “Order 42 was placed” |
| Event-carried state transfer | All the data the consumer needs, so it never has to call back. | OrderPlaced with items, address, price |
| Event sourcing | The events are the source of truth. State is rebuilt by replaying them. | A bank account as a list of deposits and withdrawals |
| CQRS with events | Writes produce events that update separate read models. | Write to the database, update a search index from events |
| Way | How it works | Good and bad |
|---|---|---|
| Choreography | Each service reacts to events and emits new ones. Nobody is in charge. | Very loose and simple at first. Hard to see the whole flow as it grows. |
| Orchestration | A central coordinator tells each step what to do, often with commands. | Easy to follow and to add retries. The coordinator is a central piece to run. |
A simplified model. Direct mode calls services in order and stops at the first failure. Events mode assumes a broker that stores events until the consumer is back (as Kafka, RabbitMQ or SQS do).
| Term | Meaning in easy words |
|---|---|
| Event | A record that something happened, named in the past tense |
| Producer / publisher | The part that creates and sends events |
| Consumer / subscriber | The part that receives events and reacts |
| Event broker | The middle system that stores and delivers events (Kafka, RabbitMQ, SNS/SQS) |
| Topic | A named channel for one kind of event |
| Command | A request that asks one service to do something. Not a fact |
| Choreography | Services react to each other's events with no central boss |
| Orchestration | A central coordinator directs the steps |
| Eventual consistency | Parts may be out of date for a short time, then catch up |
| Idempotent consumer | Handling the same event twice has the same result as once |
| Dead letter queue | A place for events that keep failing, so they can be checked later |
| Choice | We gain | We lose |
|---|---|---|
| Events instead of direct calls | Independence and failure isolation | A clear step-by-step flow and instant answers |
| Choreography | No central bottleneck, very flexible | Hard to see and change the whole flow |
| Orchestration | One place that shows the flow | A central part that knows many services |
| Fat events (carry all data) | Consumers never call back | Bigger messages and a stronger contract |
| Thin events (just an ID) | Small and simple | Consumers must call back for details |
| At-least-once delivery | No lost events | Consumers must handle duplicates |