map / distributed-systems / partitions

Distributed Systems · principle 5 of 6

Partitions

When the network splits, a system must choose between refusing some requests and risking divergent answers.

01 · Why it’s true

Networks can fail in ways that split machines into groups that can’t reach each other. From the inside, a slow or unreachable node looks the same as a dead one.

During a split, a system that accepts writes on both sides will disagree when the network heals; a system that refuses writes on the minority side stays consistent but is unavailable there. That’s the core of the CAP theorem: when a partition happens, you choose between consistency and availability. Majority quorums are a common choice — only the side with more than half the nodes keeps working, so two sides can never both accept writes.

02 · Picture it

Prefer consistencyOnly the majority side accepts writesThe minority side returns errorsNo conflicting data to merge laterSome users see an outagePrefer availabilityBoth sides keep accepting writesEveryone keeps getting answersConflicts must be merged afterwardsSome answers are stale or lostvsDuring a network split you can’t have both. Majority quorums (3 or 5 nodes) chooseconsistency: only one side can ever have a majority.
Prefer consistencyOnly the majority side acceptswritesThe minority side returns errorsNo conflicting data to merge laterSome users see an outagePrefer availabilityBoth sides keep accepting writesEveryone keeps getting answersConflicts must be merged afterwardsSome answers are stale or lostDuring a network split you can’t haveboth. Majority quorums (3 or 5 nodes)choose consistency: only one side canever have a majority.
When the network splits, each side must decide whether to keep accepting writes.

03 · In the interview

  • Explaining CAP in plain terms, without over-claiming.
  • Understanding why an odd number of nodes is common (3 or 5).
  • Avoiding split-brain: two nodes that both think they’re in charge.

04 · Practice question

“Why do coordination systems usually run 3 or 5 nodes rather than 2 or 4?”

A strong answer covers

  1. Decisions need a majority so that two sides of a split can’t both proceed.
  2. With 3 nodes the majority is 2, so you survive 1 failure; 4 nodes need 3, so they still survive only 1.
  3. With 5 nodes the majority is 3, so you survive 2 failures.
  4. Even numbers add cost without adding fault tolerance, and 2 nodes can’t survive any failure while keeping a majority.