Skip to content

6.5. Event Sourcing and CQRS

Event sourcing stores not the current state but the full sequence of changes that produced it — an append-only log of facts from which any past state can be reconstructed and any new view can be derived. Paired with CQRS, which splits the write model from the read model, it enables audit, replay, and independently scalable reads. The cost is real: eventual consistency between write and read sides, event schema evolution, and the operational weight of an ever-growing log. This chapter covers the pattern, its projections and snapshots, and when the power is worth the complexity.