Cap Theorem medium
A user reads a value '5'. They refresh and read '4' (data went backward in time). Which guarantee prevents this?
- A Atomic Broadcast, which ensures that all update messages are delivered in the exact same order to all nodes.
- B Consistent Prefix Reads, which guarantees that all users see updates in the order they were committed to the DB.
- C Read-Your-Writes, which ensures that a user can always see their own personal updates after a page refresh.
- D Monotonic Reads, which ensures that if a user has seen a specific data version, they will never see an older version.
Answer: D. Monotonic Reads, which ensures that if a user has seen a specific data version, they will never see an older version.
Monotonic Reads are essential for a sane user experience in eventually consistent (AP) systems. Without this guarantee, a user might query one replica and see a new update, then query a second (slightly stale) replica and see the old data. To the user, it looks like the system 'went back in time'. This is often implemented using 'sticky' sessions to ensure a client always hits the same replica for the duration of their session.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What is a 'Split Brain' scenario?
- The PACELC theorem extends CAP by stating: Even when there is NO partition (E), the system must choose between:
- Why is a CA (Consistent + Available) system generally considered impossible for distributed web applications?
- In CAP, 'Consistency' is equivalent to:
- In the CAP Theorem, what does the 'P' stand for?
- What causes a Network Partition?