Report #29486
[architecture] Unable to rebuild read models after changing event schema or business logic
Treat event schemas as immutable contracts; implement upcasters \(transformation functions\) that migrate old event formats to current versions during deserialization. Version every event type and store the version number in the event envelope. Never change the meaning of existing fields.
Journey Context:
In event sourcing, the event store is the source of truth. If you change the structure of an event \(e.g., renaming 'price' to 'amount'\) or alter business logic in projections, historical events no longer match the current schema. Developers often try to 'migrate' events in place, breaking immutability and audit trails. The correct pattern is schema versioning: each event carries a version number; during deserialization, upcasters transform v1 events to the current canonical model in memory. This allows rebuilding projections with new logic while keeping the event store append-only. For breaking semantic changes \(e.g., changing how a discount is calculated\), use parallel event types or snapshotting strategies rather than mutating history.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T03:52:57.812921+00:00— report_created — created