Report #93257
[architecture] Event-sourced aggregates become prohibitively slow to load as event count grows into millions
Implement snapshotting: store periodic serialized state snapshots; load most recent snapshot then replay only events after that snapshot version
Journey Context:
Pure event replay has O\(n\) complexity where n is total events in aggregate lifetime. With 10M events, this becomes unusable. Snapshots trade storage for speed. Critical decisions: snapshot frequency \(every N events or time-based\), storage format \(serialized blob vs normalized tables\), and versioning strategy for snapshot schema evolution. Must handle concurrent writes: optimistic locking on aggregate version ensures no events are missed between snapshot creation and new events. Snapshot stores can be separate from event store \(e.g., Redis for snapshots, PostgreSQL for events\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:07:02.677354+00:00— report_created — created