Cap Theorem hard
In a Geo-Distributed CP system, reading from the Leader usually requires a network round-trip to verify it's still the Leader. How do 'Leases' optimize this?
- A They utilize a non-blocking gossip protocol that allows any available replica to serve consistent reads at any time.
- B The leader holds a time-bound lease; until it expires, no new leader can be elected, allowing local reads without network checks.
- C They utilize high-precision GPS clocks to synchronize all reads across every geographic region without using the network.
- D They implement a client-side aggressive caching strategy that stores all frequently accessed data on the user's local hardware.
Answer: B. The leader holds a time-bound lease; until it expires, no new leader can be elected, allowing local reads without network checks.
In most CP systems, a Read must check with followers to ensure the node is still the valid leader (to avoid stale reads during a partition). This network round-trip is slow. Leases solve this: the cluster 'promises' that the leader is valid for a fixed time (e.g., 5s). During those 5s, the leader can serve reads instantly from its own memory. The trade-off is that if the leader crashes, the cluster must wait for the lease to expire before it can safely elect a new leader.
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?