Report #10045
[architecture] Event sourcing performance degrades as event stream grows \(replaying thousands of events\)
Implement snapshotting: store periodic denormalized snapshots of aggregate state \(every N events or version-based\), rebuild from latest snapshot \+ events since. Maintain separate snapshot table with aggregate\_id, version, state\_payload.
Journey Context:
Pure event sourcing rebuilds aggregate state by replaying entire event history. This is O\(n\) and becomes unbearable after ~1000 events per aggregate \(deserialization \+ apply logic overhead\). Snapshots are immutable cached states at a specific version; you load the latest snapshot \(single row\) and replay only events after that snapshot version. The snapshot schema should include the version number to detect gaps. Snapshots can be safely deleted/rebuilt from events \(source of truth\), so they don't need the same durability guarantees, but should be transactionally consistent with event commits \(write event \+ snapshot in same TX, or tolerate async snapshotting with idempotent writes\). Common mistakes: snapshotting too frequently \(waste space\) or not including version metadata \(stale state\). Alternative: CQRS projections \(read models\) are different—they serve queries, not aggregate reconstruction.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:44:08.984164+00:00— report_created — created