🏗️Event Sourcing
Also known as Event Store, Event Log
Save each change as an event. Build the present state from them.
Think of it like
Think of it like a bank statement. It lists each deposit and each spend. The balance is the sum.
Example
Jack's bank app stores each deposit and payment as an event. To show a balance, it adds them up. When a customer asks about a charge from March, it is all there.
Why it matters
You can see exactly how data got to where it is, which helps with audits and bug hunts.
Definition
Common mistake
Key takeaways
- 1Store the changes. Not just the result.
- 2Replay to rebuild. State comes from events.
- 3Full history. Nothing overwritten.