Few architecture topics produce as much talking past each other as "event-driven architecture". In 2017, Martin Fowler wrote a whole article after a meeting where everyone in the room used the word "event" for something different.
This article separates the concepts, shows when each one is worth the cost and covers the patterns that make it all work in practice: outbox, idempotency, snapshots and event versioning. I checked sources and versions on November 21, 2026.

Command, Event and Message
First, three words that the book Enterprise Integration Patterns, by Gregor Hohpe and Bobby Woolf, helped tell apart:
| What it is | Tense | Can it be rejected? | |
|---|---|---|---|
| Message | The envelope that travels between systems | ||
| Command | A request to do something | Imperative: BookRoom |
Yes |
| Event | The notice that something happened | Past: RoomBooked |
No, it already happened |
Think of a coffee shop counter: "make me a coffee" is a command, and the barista can say the machine is broken. "Coffee 42 ready" on the screen is an event; rejecting it makes no sense.
The trap Fowler points out: events that are really orders in disguise, like SendWelcomeEmailRequested. He calls this a "passive-aggressive command". If the publisher expects someone to do something specific, it's a command.
The Four Meanings of "Event-driven"
1. Event Notification
The system announces that something changed and doesn't care who's listening. The event is usually thin: OrderCreated { orderId: 42 }. Anyone who wants details queries the source.
The gain is low coupling. The cost, according to Fowler: the full flow doesn't show up anywhere in the code. When something goes wrong, nobody can say off the top of their head which services react to OrderCreated.
2. Event-carried State Transfer
The event carries the data: CustomerChangedAddress { customerId, street, city, zipCode }. The shipping service keeps a local copy and doesn't need to query the customer service. More resilience and less latency, at the cost of several copies of the same data spread around.
3. Event Sourcing
Every state change is stored as an event, and the event log becomes the source of truth. The current state is calculated from it.
4. CQRS
Separate models for writing and for reading. Fowler makes a point of saying that CQRS isn't strictly about events; it just tends to show up alongside them.
The first two are ways for services to communicate, and the article on message queues covers the infrastructure. The last two are ways to model data, and they're the focus from here on.
Event Sourcing: The Bank Statement
Your bank doesn't store just the balance. It stores every transaction, and the balance is the sum. If there was a mistake, nobody deletes the line: they post a reversal. That's event sourcing.
type AccountEvent =
| { type: 'Deposited'; amount: number }
| { type: 'Withdrawn'; amount: number }
| { type: 'WithdrawalReversed'; amount: number };
function balance(events: AccountEvent[]): number {
return events.reduce((total, e) => {
switch (e.type) {
case 'Deposited': return total + e.amount;
case 'Withdrawn': return total - e.amount;
case 'WithdrawalReversed': return total + e.amount;
}
}, 0);
}What you gain:
- Full audit trail: every change, who made it and when.
- Time travel: what was the state on March 1? Just sum the events up to that date.
- New views of the past: came up with a report today? It can be calculated over the whole history.
What you pay, and Microsoft's documentation is emphatic about it: it's a complex pattern, migrating to it or away from it is expensive, and "For most systems and most parts of a system, traditional data management is sufficient."
The Details That Bite in Practice
Design the event with intent. Microsoft gives the example: "two seats were reserved" says more than "remaining seats changed to 42". The second is state; the first is a business fact.
Concurrency. Two requests read the same stream with 5 free seats and try to book. The event store rejects the second write because the stream changed since it was read (optimistic concurrency), and that request retries with the updated state.
Snapshots. An account with 50,000 events shouldn't sum everything on every read. Every so often you store a picture of the state, and the sum starts from it. But the snapshot is an optimization, not the truth: the truth is still the log.
Versioning. Events are never edited. When the format changes, the usual technique is upcasting: a function converts the old event to the new format at read time, and the log stays intact.
Replay with external side effects. When reprocessing events to rebuild a view, the system can't send the email again or charge the customer a second time. Fowler warned back in 2005 that external systems "don't know the difference between real processing and replays". Turn off integrations during replay and make consumers idempotent.
Personal data. Immutable events and the right to have data deleted under privacy laws like GDPR clash. The options Microsoft mentions: keep personal data outside the event and reference it by ID, or encrypt it with a per-person key and delete the key when the person asks (crypto-shredding).
Kafka is not an event store. Microsoft's documentation spells it out: "Message brokers such as Apache Kafka typically lack per-entity stream queries and optimistic concurrency." They distribute events; they don't replace a database built for the job, like KurrentDB (formerly EventStoreDB), Marten (on top of PostgreSQL) or Axon.
CQRS: Kitchen and Menu
In a restaurant, the kitchen works with rules, stock and ingredients. The menu shows everything ready, organized for whoever is choosing. They're different views of the same business, tuned for different uses. CQRS applies this to code.
Microsoft describes two levels:
- Separate models in the same database. The write side uses entities with rules; the read side uses optimized queries that return DTOs ready for the screen. This is the foundational level, and it already solves a lot.
- Separate databases. The read side lives in another database (a materialized view, a search index), updated by events. More scale, and with it comes eventual consistency: reads lag a few moments behind writes.
// Write: command with business intent
async function bookRoom(cmd: { hotelId: string; roomId: string; guestId: string }) {
const room = await repo.load(cmd.roomId);
room.book(cmd.guestId); // business rules here
await repo.save(room);
}
// Read: direct query, no rules, shaped for the screen
async function availableRooms(hotelId: string) {
return db.query(
'SELECT number, type, price FROM vw_available_rooms WHERE hotel_id = $1',
[hotelId],
);
}Look at the command name. Microsoft recommends commands as business tasks ("Book hotel room"), not as field changes ("Set ReservationStatus to Reserved").
When CQRS Pays Off
Microsoft's criteria: far more reads than writes, task-based screens, separate teams for each side, a collaborative setting with heavy contention over the same data.
When it doesn't pay off: simple business rules and CRUD screens. And Fowler's 2011 warning still holds: "for most systems CQRS adds risky complexity", and most of the cases he saw went badly. If the problem is just one heavy report, a separate reporting database can solve it without changing the architecture.
Publishing the Event Without Losing Anything: Outbox
A problem shows up as soon as the event leaves the service. You save the order in the database and publish OrderCreated to the broker. If the database write succeeds and the broker fails, the event is lost. If the broker gets it and the database fails, there's an event for an order that doesn't exist. No transaction spans both.
The fix is the transactional outbox: the event is written to a table in the same database, in the same transaction as the order. A separate process reads that table and publishes to the broker.
BEGIN;
INSERT INTO orders (id, customer_id, total) VALUES ($1, $2, $3);
INSERT INTO outbox (id, aggregatetype, aggregateid, type, payload)
VALUES (gen_random_uuid(), 'order', $1, 'OrderCreated', $4);
COMMIT;The publishing process can poll the table or read the database log directly with a CDC tool like Debezium (3.7), which has a ready-made router for this table format.
And the detail that always comes back: the publisher may send the same event twice. The consumer has to be idempotent, storing the IDs it has already processed.
Sagas: A Transaction That Spans Services
When a business process goes through several services (booking a flight, a hotel and a car), you can't use a database transaction. The saga, an idea from a 1987 paper by Garcia-Molina and Salem, splits the process into local transactions; if one fails, compensating transactions undo the previous ones.
There are two styles: choreography, where each service reacts to the others' events, and orchestration, where a coordinator sends commands and decides the next step. The article on modular monolith vs microservices has the animation of a saga undoing its steps.

Quick check
Frequently Asked Questions
Do I need microservices to use events?
No. A monolith can publish internal events between modules, and it's a great way to reduce coupling without paying the cost of the network.
Which database should I use for event sourcing?
To start, PostgreSQL does the job: an events table with stream, version and payload, and a unique constraint on stream and version for optimistic concurrency. Marten does this for .NET. Dedicated databases like KurrentDB help at high volume.
Will eventual consistency confuse users?
It can. The screen that just saved should show the result of its own command, not reread the read model. The delay is usually milliseconds, but it has to be handled.
Can event sourcing and privacy laws like GDPR coexist?
Yes, with care: personal data outside the event, or encrypted with a key per data subject.
Where should I start?
With domain events inside your own system and a separate read model for the heaviest screen. Event sourcing only when history is a business requirement.
References
Checked on November 21, 2026:
- Martin Fowler, What do you mean by "Event-Driven"? (2017), CQRS (2011), Event Sourcing (2005) and The LMAX Architecture (2011)
- Greg Young, CQRS Documents (2010)
- Microsoft Azure Architecture Center, CQRS and Event Sourcing
- Gregor Hohpe and Bobby Woolf, Enterprise Integration Patterns: Command Message and Event Message
- Chris Richardson, Saga and Transactional Outbox; Garcia-Molina and Salem, Sagas (1987)
- Debezium Outbox Event Router, KurrentDB, Marten, Axon, AWS EventBridge