Report #57280
[architecture] Event sourcing without snapshots causes unbounded aggregate rebuild latency
Implement snapshotting to persist aggregate state every N events \(e.g., every 100 events\) or time-based; load the latest snapshot then replay only events since that snapshot. Store snapshots in a separate table/collection with versioning.
Journey Context:
Naive event sourcing rebuilds an aggregate by replaying all historical events from event 1. For long-lived entities \(bank accounts, user profiles with 10 years of history\), this becomes linearly slower and memory-intensive, eventually violating latency SLAs. Snapshots are derived state \(can be rebuilt from events\) that cap the replay cost to a constant number of events \(the snapshot frequency\). Tradeoffs: Snapshots add write complexity—must be atomic with event commit or handled via outbox/saga to avoid inconsistency; they consume extra storage; choosing snapshot frequency balances write overhead \(frequent snapshots = slower writes\) vs read speed. Do not use snapshots as the primary persistence—events remain the source of truth; snapshots can be deleted and rebuilt. Frameworks like EventStoreDB automate this; in DIY SQL solutions, use a snapshots table with \(aggregate\_id, version, state\_json, created\_at\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T02:37:53.725988+00:00— report_created — created