Bird
0
0

In a microservices system using an event store, how can you efficiently rebuild the current state of a service that has millions of events without replaying all events every time?

hard📝 Trade-off Q15 of 15
Microservices - Event-Driven Architecture
In a microservices system using an event store, how can you efficiently rebuild the current state of a service that has millions of events without replaying all events every time?
AUse snapshots to save intermediate states periodically
BDelete old events after a certain time to reduce replay
CStore only the latest event per entity to minimize data
DReplay events in parallel without ordering
Step-by-Step Solution
Solution:
  1. Step 1: Identify replay challenges with many events

    Replaying millions of events is slow and inefficient for rebuilding state.
  2. Step 2: Evaluate solutions to speed up rebuilding

    Snapshots save the state at points in time, allowing replay from snapshot forward, reducing events to process.
  3. Final Answer:

    Use snapshots to save intermediate states periodically -> Option A
  4. Quick Check:

    Snapshots optimize replay by reducing event count [OK]
Quick Trick: Snapshots speed up state rebuild, don't delete events [OK]
Common Mistakes:
MISTAKES
  • Deleting old events breaks audit and consistency
  • Storing only latest event loses history
  • Replaying events out of order causes errors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes