The superpower of stored events
Because events are the durable source of truth, you can throw away any derived view and rebuild it by replaying the history. This makes fixing a broken projection or adding a new one a routine operation rather than a migration crisis.
When you replay
- A projection has a bug and produced wrong data.
- You need a brand new read model that did not exist before.
- You want to recover after data loss in a derived store.
How a safe rebuild runs
- Build the new view into a fresh table, leaving the live one serving traffic.
- Replay events from position zero into the new view.
- Catch up to the live tail, then atomically switch reads over.
Hazards to control
- Side effects. Replay must not resend emails or recharge cards. Suppress external actions during rebuild.
- Throughput. Long histories take time, so replay in parallel by stream where order allows.
- Versioning. Old events may need upcasting to the shape the new handler expects.
Key idea
Because events are durable truth, you can rebuild any view by replaying history, as long as side effects are suppressed and old events are upcast.