Why Event Sourcing Should Be the Default
The Complexity Comes From Aggregate Streams, Not From Events
I have been building software for 35 years. In this time I have seen teams put a lot of energy into scalability and resilience for applications that never reached the load they were built for. The same teams reject Event Sourcing, because they consider it too complex for a normal business application.
I think they are right about the complexity they have seen. However, most of it does not come from storing events. This time I want to show where it comes from, and what is left without it.
The Record of a Business
A business keeps a record of what happened. Pat Helland points to accounting for this: a wrong entry stays in the ledger, and a new entry corrects it. He describes databases in the same way. "The truth is the log" (Pat Helland, Immutability Changes Everything) and the tables are a cache of the latest values in it.
Warehouses work like this as well. In ERP systems a goods movement is posted as a document, and a posted document cannot be changed. If the quantity was wrong, the movement is reversed with a new document. The stock ledger, a history of all stock movements with the balance after each one, is a standard report in inventory systems.
This means that the software of a business keeps what happened anyway, because the business asks for it. The only question is whether the events are the data of the application or a second record next to its tables. In my view they should be the data. Simply store what happened, and compute everything else from it.
The Critics Are Right
Why is Event Sourcing not the default then? Because of its reputation, and the reputation has good reasons. Microsoft's architecture guidance says that traditional data management is enough for most systems, and it lists prototypes and MVPs among the cases where the pattern does not fit. Chris Kiehl described what he ran into with it: read models that lag behind the writes, an event change that has to be repeated in every projection, and a lot of plumbing around aggregates and projections.
I have used Event Sourcing with aggregates and CQRS in several projects, and I know these problems. I don't think the critics are exaggerating. I think they're describing one possible way to implement it.
Three Additions
If you sort these objections by their cause, you find three things that the usual setup adds to the idea of storing events.
- A stream per aggregate. Every aggregate gets its own stream of events, and the stream is the boundary of consistency. An append is checked against the version of one stream.
- Read models that are updated later. Handlers follow the events and update tables for the queries. Therefore a query can miss what was just written, and a handler must tolerate an event that arrives twice.
- Events as messages. Other services subscribe to the events. From then on the events are a contract between teams.
The stream per aggregate has the largest consequences. You have to cut the aggregates before you write the first event, and a rule that needs two aggregates does not fit into one stream. The DCB website explains this with a course and a student. A subscription touches both, so the usual setup needs a saga that coordinates two streams.
Microsoft names the same gap with an example from a warehouse. A stock reduction arrives while a customer orders the same item. Optimistic concurrency does not help here, because it protects one stream only, and the guidance leaves it to the application to reconcile the situation afterwards.
None of the three additions is needed to store what happened and to decide on it.
What Is Left
What is needed instead is one condition on the append. A command reads the events it needs with a query and computes its result. It appends new events only if no event that matches the query was stored after its read. The query defines the boundary, and it defines it per command. This is the idea of Command Context Consistency, as Ralf Westphal and I described it, and of Dynamic Consistency Boundary (DCB). Both concepts describe the same conditional append.
With this condition, the unit of work is one domain capability. A capability is one thing the application provides, such as reserving stock. It reads, computes and appends.
In my last article I showed that a query by event types alone is enough for this. The store then keeps a position, a type and some bytes for every event, and it never opens a payload.
Stock That Must Not Run Out
Let's take the case that Microsoft calls hard. I built a warehouse example application with seven capabilities using ActaDB, an embedded, file based event store that I published as a Rust library. Events are the only thing the system stores. Its capability Reserve Stock may only reserve what is available.
Four event types change the available quantity of an item. This is the query of the capability:
Query::event_types([
GOODS_RECEIVED,
STOCK_RESERVED,
RESERVATION_RELEASED,
STOCK_ADJUSTED,
])
The capability adds up the events of its item and gets the available quantity. The rule itself is a function without I/O:
pub(super) fn reserve_stock(
command: &ReserveStock,
context: &ReserveStockContext,
occurred_at: i64,
reservation_id: &ReservationId,
) -> (StockReservation, Vec<StockReserved>) {
if u64::from(command.quantity.get()) > context.available {
return (
StockReservation::Rejected(StockReservationRejection::InsufficientStock),
vec![],
);
}
let event = StockReserved {
reservation_id: reservation_id.0.clone(),
sku: command.sku.clone(),
quantity: command.quantity.get(),
order_ref: command.order_ref.clone(),
occurred_at,
};
(
StockReservation::Reserved {
reservation_id: reservation_id.clone(),
},
vec![event],
)
}
Notice that the function returns the result and the events. A rejection is a normal result without events, and nothing is stored for it.
The events are appended with the token of the read:
match warehouse
.store
.append(events, Some(selection.token))
.map_err(ReserveStockError::Store)?
{
Commit::Appended { .. } => return Ok(result),
Commit::Conflict => continue,
}
If a receipt, another reservation, a release or a count was stored after the read, the store answers with a conflict. The capability then reads again and computes again. This is exactly the situation from Microsoft's example. Here the store detects it, and the capability either reserves from the new quantity or rejects the reservation. Nothing has to be reconciled afterwards.

No Saga Needed
What about a rule across two aggregates? Issue Goods is one. It issues the goods of a reservation, so it needs the state of the reservation. It must not issue more than is on hand, so it needs the stock of the item as well.
Derek Comartin shows a warehouse with Event Sourcing in the usual form: one aggregate per product with its own stream, and methods to ship, receive and adjust. This works well as long as every rule looks at one product. With reservations you have to decide where a reservation lives. If it lives in the stream of the product, you need a way to find the product from the reservation. If it has its own stream, the rule about the stock on hand spans two streams. You make this decision before the first reservation exists.

In my warehouse example application, Issue Goods names five event types in its query and computes both things from them. It has four reasons to reject:
- the reservation does not exist,
- it is already issued,
- it is already released,
- or the stock on hand does not cover it.
A rule across two aggregates costs more event types in a query and nothing else.
Queries work the same way. Stock Overview reads the events of five types when the request arrives, and it computes the quantities on hand, reserved and available for every item. There is no handler that updates a table later. Therefore the answer includes every event that was stored before the read.
Read Only What Is New
Is this fast enough? Not if every request reads all events of its types. I measured this in my last article: a reservation took 7.5 ms with 1,000 events in the store and 480 ms with one million.
Therefore the capabilities of the app keep what they built. Reserve Stock keeps the available quantity of every item, together with a checkpoint of its last read. The first request after a start reads all events of the four types. Every later request reads only the events after the checkpoint:
let selection = match &kept.checkpoint {
None => warehouse.store.query(&query()),
Some(checkpoint) => warehouse.store.query_after(checkpoint),
}
.map_err(ReserveStockError::Store)?;
kept.add(&selection.records)?;
kept.checkpoint = Some(selection.checkpoint);
let context = kept.context(&command.sku);
Notice that the append did not change. It still carries the token of the read, so the condition is the same.

I measured this on my MacBook, with the capabilities called directly, one request after the other. The first time is the typical request (the median). The time in brackets is the slow request (the 95th percentile).
- 1,000 events in the store: a later reservation took 11.6 ms (22.8 ms). The first reservation after a start took 13.2 ms.
- 10,000 events in the store: a later reservation took 11.4 ms (17.4 ms). The first reservation after a start took 25.0 ms.
- 100,000 events in the store: a later reservation took 10.9 ms (27.2 ms). The first reservation after a start took 96.8 ms.
- 1,000,000 events in the store: a later reservation took 12.1 ms (19.0 ms). The first reservation after a start took 796 ms.
A later reservation takes the same time at every size, and almost all of it is the append. A reservation that is rejected reads and computes as well, but it stores nothing, and it took about 0.01 ms at every size. Stock Overview never stores anything. After its first request it also answered in about 0.01 ms at every size.
If you compare this with my last article, you see that a reservation with 1,000 events in the store took 7.5 ms there. The difference is the append. Since then the store can be opened by several processes at the same time, and a write takes about 11 ms on my machine, where it took about 6 ms before.
This has a price. The kept quantities are in the memory of the process, and after a restart the first request reads everything again. With one million events this took about 0.8 seconds. With several threads, a capability needs one lock from its read to its append. I think this is a fair price, because the store did not get more complex. It got one more way to read, and it still has no snapshots and no streams to manage.
What a Change Costs
How does such an app change? It grows by one capability at a time. You build the first capability, and it is done. You add the next one, and the ones you already have stay as they are. This is why you never have to design the whole application first. Each new capability starts with the events that are already stored, so it also answers for the time before it existed.
The only thing that reaches an existing capability is a new event that matters for its rule. Then this capability reads the new event as well, and that is the whole effect. When I added the count to the warehouse app, Reserve Stock got StockAdjusted in its query, because a count changes what is available.
StockAdjusted is read by five capabilities today. This makes an event a contract between them, which is Kiehl's point about events. Here the contract stays inside one application. In addition, a capability declares only the fields it uses, so a new field in an event does not touch it.
Most Applications Never Get There
Where are the limits? The store writes one batch at a time. In my measurement the app stored about 75 reservations per second, one after the other. In addition, a query by event types has a wide conflict area. Every new event of a queried type counts, also when it belongs to another item, so under heavy load more commands have to compute again. A query that is narrowed by values of the payload or by tags reduces this.
For scale: 75 writes per second are more than six million events per day. In my experience, about 80 percent of the business applications I have seen never get near this number.
Two points stay open, and they come with every record that is never changed. Events get new shapes over the years, and personal data must be deletable. There are known answers to both.
The Choice That Needs a Reason
Today a team has to justify Event Sourcing, and nobody has to justify a table that keeps only the current state. I think it should be the other way round. A table with the current state does not keep what happened, and it needs a model that is designed before the first feature exists. An application that stores what happened loses nothing, and it grows one capability at a time.
My warehouse app example is on GitHub. Run it, read one capability, and tell me where it gets complex.
Cheers!
Sources
[1] Pat Helland, "Immutability Changes Everything", ACM Queue, 2015, https://queue.acm.org/detail.cfm?id=2884038
[2] Microsoft Azure Architecture Center, "Event Sourcing pattern", https://learn.microsoft.com/en-us/azure/architecture/patterns/event-sourcing
[3] Chris Kiehl, "Don't Let the Internet Dupe You, Event Sourcing is Hard", 2019, https://chriskiehl.com/article/event-sourcing-is-hard
[4] Derek Comartin, WarehouseProduct, https://gist.github.com/dcomartin/9db8f9281a2f45a19d93ee469d63bd4c