All Questions
Data Modeling hard

In an Event Sourced system, replaying 1 million events to calculate 'Current Balance' is too slow. How is this solved without abandoning the pattern?

  1. A Snapshotting, which periodically saves the materialized state so that the system only needs to replay the small number of events that occurred after the latest snapshot.
  2. B Event Truncation, where the system identifies and permanently deletes every 'stale' historical event that has already been factored into the current state calculation.
  3. C Hardware Acceleration, which leverages specialized high-frequency multicore CPUs to perform millions of event-replay operations in a single, ultra-low latency cycle.
  4. D Distributed Caching, where the final calculated result is stored in an external Redis cluster with a permanent TTL to ensure that the event log is never accessed again.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions