Your table says the balance is 1,000. Ask it how.
transcript
Your accounts table says the balance is 1,000. What was it on January the first? It can't tell you.
A normal table stores only the current state. One number. Every update overwrote the one before. How it got here is gone. So any past date is a mystery.
Event sourcing stores the events instead. Account created, at zero. Deposited 500. Deposited 700. Withdrawn 200. Nothing is overwritten. Events are only appended.
Replay all of them. 0, plus 500, plus 700, minus 200. 1,000. Replay up to January the first, and you get that day's balance. Replay them to reproduce a bug. And you have a full audit trail.
The catch? Old events keep their old shape. Schemas must evolve. Long event streams are slow to rebuild. So you take snapshots, for performance.
It pairs with CQRS. Commands append events to the event store. Queries read separate models built for reading. A search index, or a cache.
Store what happened. Derive what is.
Full breakdown in the lecture.