In a request-driven system, the checkout service calls inventory, then payments, then email, and waits for each one. In an event-driven system, checkout announces "order placed" and moves on. Whoever cares about that fact reacts in their own time.
An event is a record of something that already happened, named in the past tense: OrderPlaced, PaymentCaptured, KycVerified. It is a fact, not an instruction. That is the difference from a command such as ChargeCard, which asks one specific service to do something.
How it works
- Producers publish events when their state changes.
- A broker stores and delivers them. Kafka keeps a replayable log. RabbitMQ and Amazon SQS are queues. Amazon EventBridge and Google Pub/Sub are managed routers.
- Consumers subscribe and react. Each keeps its own data, built from the events it has seen.
Adding a consumer doesn't change the producer. That is the main benefit: teams add features without coordinating releases. The cost is that no single place shows the whole flow, and data across services is eventually consistent.
Four patterns people call "event-driven"
In a 2017 article, Martin Fowler pointed out that the term covers four different patterns:
- Event notification. The event says "customer 42 changed address", and consumers call back for details.
- Event-carried state transfer. The event includes the new address, so consumers don't need to call back.
- Event sourcing. Events are the system's primary record, and current state is rebuilt from them.
- CQRS. Separate models for writing and reading, often kept in sync with events.
Most systems use the first two. Be clear which one you mean when you design.
Example: a UPI payment
A payment app receives a success callback from its payment service provider and publishes:
{
"specversion": "1.0",
"type": "payment.captured",
"source": "/payments",
"id": "evt_01JH8Q2K7M",
"time": "2026-11-21T10:42:07Z",
"data": { "paymentId": "pay_9f2c", "orderId": "ord_5521",
"amountPaise": 149900, "method": "upi" }
}
This envelope follows CloudEvents, a CNCF specification for event metadata that graduated in January 2024. Four consumers read the same event independently:
- Ledger posts the double entry.
- Orders marks
ord_5521as paid. - Notifications sends the receipt.
- Fraud updates the customer's risk features.
If the notification service is down for ten minutes, payments and the ledger carry on. Notifications catch up from the broker when they recover.
Things to get right
- Publish reliably. Saving to the database and then publishing can lose the event if the process crashes in between. Use the transactional outbox.
- Consume idempotently. Brokers deliver at least once, so handle duplicates using the event
id(see idempotency). - Version event schemas and keep a schema registry. Consumers you don't know about depend on them.
- Trace across services with a correlation ID in every event.
- Don't use events for everything. If the caller needs an answer now, such as "is this coupon valid?", a synchronous API call is simpler.
Choosing a broker is covered in Kafka vs RabbitMQ vs SQS.