Cap Theorem hard
In a CP system, if a leader is partitioned from the majority but still visible to clients, it must stop accepting writes. How does it know to stop?
- A The leader utilizes an internal heartbeat signal to ping the Witness node and confirm that the primary network link is still active.
- B It fails to receive heartbeats from a majority of followers; without a Quorum, it cannot commit new writes and must step down.
- C The database process identifies the network failure and automatically enters a strictly Read-Only maintenance mode at the OS level.
- D The client application identifies that the node is no longer part of the majority cluster and sends a 'Halt' command to the leader.
Answer: B. It fails to receive heartbeats from a majority of followers; without a Quorum, it cannot commit new writes and must step down.
CP systems (like Raft or Paxos) require a majority to commit any change. A partitioned leader might still be able to talk to some clients, but when it attempts to replicate a write, it will fail to reach the necessary quorum (N/2 + 1). Most protocols also require leaders to continuously receive 'heartbeat' acknowledgements from a majority to maintain their leadership. If heartbeats fail, the partitioned leader realizes it is no longer the valid master and stops accepting new requests.
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?