Rebuild a read model
Goal: you changed a projection (added a property, fixed a mapping) and the existing read model still reflects the old logic. You want it rebuilt from the events.
Why this works
Section titled “Why this works”Read models are derived data — the event log is the source of truth. So a read model is always disposable: Chronicle can replay the events through the projection and produce it again from scratch. You never migrate a read model in place; you rebuild it.
- Make your projection change and deploy it.
- Replay the observer so it reprocesses the event sequence from the beginning and rewrites its read model. You can trigger a replay from the Workbench or programmatically as part of your deployment.
- Query the read model and confirm it reflects the new logic.
- A rebuild reprocesses all matching events, so for very large streams it takes time proportional to the history. Plan rebuilds of big projections accordingly.
- Reducers rebuild the same way — they’re also derived from events.
See also
Section titled “See also”- Read Models — consistency and how read models are served.
- Projections — the full projection model.