Report #11569
[architecture] Event sourcing read model performance degrading as aggregate event count grows unbounded
Implement snapshotting at regular version intervals \(e.g., every 100 events\) storing the denormalized aggregate state. Rebuild state by loading the latest snapshot and replaying only events since that snapshot version. Store snapshot\_version alongside aggregate\_version to detect stale snapshots.
Journey Context:
Pure event sourcing requires replaying the entire event stream to reconstruct aggregate state, resulting in O\(n\) load times that increase linearly with history. This becomes unacceptable for long-lived aggregates \(bank accounts, user profiles\). Snapshotting trades storage for speed by persisting periodic checkpoints of the aggregate state. The pitfall is snapshotting too frequently \(write amplification\) or failing to version the snapshot schema; if the aggregate's state structure changes, old snapshots must be discarded or migrated. The snapshot is not the source of truth—events are—so corruption in a snapshot is recoverable by replaying from an earlier snapshot or event zero. Implement snapshotting as a background process or on read-side demand when event count since last snapshot exceeds threshold.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T13:42:38.486770+00:00— report_created — created