Skip to content

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.

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.

  1. Make your projection change and deploy it.
  2. 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.
  3. 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.