Architecture / 9 / 9
Event sourcing
An online shop keeps one row per order and updates it in place. Disputes cannot be answered and two edits at once silently overwrite each other. Event sourcing stores every change as an immutable event in a stream with a version, rebuilds state and read models from the events, and then has to deal with long streams, old event formats, read lag and the right to be forgotten.
- 15 min
- Advanced
- 12 steps
- Disputes with no answer
- 0 /day
- Overwritten edits
- 0 /day
- Read model lag
- 0 ms
- Load one stream
- 3 ms
- request
- reply
- redelivery
- duplicate
- lost
Numbers are a model scenario, not measurements
The real request
Order service → Orders tableRequest
UPDATE orders
SET address = '12 Elm St',1
status = 'paid',2
updated_at = now()3
WHERE id = 'ord_77';
Response
UPDATE 14
SET— The new value replaces the old one. The old one is gone.status— One column holds the whole life of the order, only its last state.updated_at— When something changed last, not what changed.UPDATE 1— Done. Nothing remembers the address before this one.
Build it yourselfCheat sheetCompare lessons
Course: 74 lessons
01 Foundations
02 Scaling
03 Data & storage
04 Communication
05 Reliability
06 Architecture
07 Security
08 Shipping
09 Whole systems
10 Business processes
11 Case studies