Cap Theorem easy
To achieve Strong Consistency in a cluster of N nodes, a Quorum-based system typically requires writes to be acknowledged by:
- A A single local node (e.g., W=1) to ensure the absolute minimum possible write latency for the end-user.
- B Every single node in the entire cluster (N) to ensure that the data is perfectly synchronized across the globe.
- C A simple majority of the nodes (e.g., N/2 + 1) to ensure that no two conflicting groups can form a consensus.
- D A random subset of the nodes that is dynamically calculated based on the current estimated network health.
Answer: C. A simple majority of the nodes (e.g., N/2 + 1) to ensure that no two conflicting groups can form a consensus.
A Majority Quorum is the cornerstone of many CP systems (like Raft or Paxos). It ensures that at least one node in any future read operation will overlap with the majority of nodes that performed the latest write. This prevents the 'Split Brain' problem because you cannot have two different majorities in the same cluster. This allows for Consistency without requiring 100% of the nodes to be reachable.
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?