Report #42108
[architecture] Event sourcing aggregate performance degradation with large event streams
Store versioned snapshots of aggregate state with the event sequence number, and replay only events newer than that version
Journey Context:
Replaying thousands of events to rebuild an aggregate state becomes prohibitively slow \(linear time\). Snapshots \(serialized aggregate state\) solve this but introduce a critical failure mode: if the snapshot is taken at version N but the code schema changes before version N\+1, deserializing old snapshots may fail or return corrupt state \(schema evolution problem\). Always store the version number with the snapshot, validate it on load, and if the snapshot format is incompatible, discard it and replay from event 0 \(or migrate the snapshot\). Never store snapshots in the same stream as events; use a separate snapshot store or table. Snapshots are an optimization, not a source of truth.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:09:08.745776+00:00— report_created — created