Report #15317
[architecture] Event sourcing event schema changes breaking projections or requiring full replays
Implement event upcasting in the deserialization layer: store event type and version metadata, deserialize raw JSON through a chain of transformation functions \(upcasters\) that migrate old event schemas to the current canonical schema before applying business logic.
Journey Context:
Modifying stored events in-place breaks the immutable audit trail and temporal querying. Creating new event tables per version fragments the stream. Replaying the entire event store to rebuild projections after every schema change is operationally prohibitive for large streams \(terabytes of events\). Upcasting intercepts the deserialization path: an event stored as \`v1\` is transformed to \`v2\` in memory by the upcaster chain, allowing the aggregate/projection code to only handle the current schema. Common mistake: using weak typing \(maps/dictionaries\) for events to avoid schema changes, which sacrifices type safety and refactoring capability.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:46:56.578585+00:00— report_created — created