Skip to content

Event Sourcing Handbook

Every write in Kumiko is stored as an event, an immutable record of what happened. Tables are derived from those events and can be rebuilt at any time. This gives you audit trails, time travel, undo, and realtime updates without separate write paths.

You do not need to understand event sourcing to ship. This handbook has four levels, and each is useful on its own. Move to the next level only when your app needs it.

LevelYou learnYou need it when
1, CRUD, no jargonr.crud, one call, full CRUDAlways. This is the default way to ship an entity.
2, Events & projectionsYour own domain events and read modelsYour domain has verbs beyond create/update/delete (“approve”, “pay”).
3, EvolutionUpcasters, snapshots, time travelYour event shapes change, or aggregates grow long histories.
4, Scale & operationsCross-aggregate read models, rebuilds, opsYou aggregate across entities, or you run this in production.

Every code block in this handbook is embedded from a tested, runnable recipe, the same files that run in CI: basic-entity and event-sourcing.

Prefer concepts over a guided path? Read How events work, the same model, explained top-down.