Report #4910
[architecture] Event sourcing aggregate rehydration timeouts with large event streams
Implement snapshotting by storing aggregate state snapshots every N events \(e.g., every 100 or 1000 events\) in a separate snapshots table; rehydrate by loading the latest snapshot and replaying only events with sequence\_number > snapshot\_version instead of replaying from event zero.
Journey Context:
Pure event sourcing requires replaying the entire event history to reconstruct aggregate state, which becomes prohibitively slow as streams grow \(imagine replaying 5 million events for a single aggregate\). Snapshotting trades write performance \(must write snapshot \+ event atomically\) for read performance. Implementation details: snapshots must be treated as opaque value objects \(serialized state\) with a version marker; they are a performance optimization, not a source of truth. The system must handle 'concurrent snapshot' race conditions by preferring events over snapshots if unsure. Alternatives considered: Event streams should be split \(temporal decoupling\) when aggregates get too large, but this changes domain model. Tradeoffs: Snapshots complicate the event store implementation and require storage overhead \(duplicate state\), but are essential for production systems with long-lived aggregates.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:16:46.176509+00:00— report_created — created