skip to content

Nodes are split evenly across exactly two failure domains — why is a third domain still worth adding?

level: middleimportance: must knowfreq 57%

answer

  1. majority means strictly more than half
  2. an even split survives nothing
  3. uneven across two is a bet
  4. odd totals cannot split evenly
  5. third domain breaks ties, not load

basics

~20 s

An even split leaves each survivor holding exactly half, and half is never a majority. Losing either domain therefore leaves no majority of the copy set or of the membership holding cluster metadata. A third domain makes one survivor decisive, even if it only breaks ties.

solid answer

~50 s

Two domains look symmetric and that is the trap: with an even split, whichever domain is lost, the survivor holds exactly half, and half is not a majority. Where a write commits on a majority of a partition's copies, no write can commit; where the membership holding cluster metadata needs a majority of itself, a structural change has no majority available either. An uneven split across two domains only moves the problem — the layout survives losing the small domain and not the large one, so the outcome depends on which one failed. A third domain fixes the arithmetic rather than the hardware: spread across three, any single loss leaves roughly two thirds alive, which is a majority whichever domain went. The third domain can be small — it needs to hold a tie-breaking member, not a full share of the traffic.

go deeper

for a junior

Hold on to the definition: a majority is strictly more than half. Two equal halves means neither side is a majority, which is why an evenly split pair of locations is a weaker arrangement than it looks.

for a middle

Do the counting out loud — what each domain holds, what survives each loss, and why an odd total across three domains is the shape that works. Mention that the third domain can hold a single tie-breaking member.

for a senior

Apply the rule twice: to the copies of each partition and to the membership holding cluster metadata. Recognise the uneven two-domain split as a bet on which domain fails, and say what your own cluster would do today.

for a principal

Own the case where a third domain does not exist — an explicit manual intervention, its rehearsal, and who is allowed to make the call — and weigh the third domain's distance against the hop it adds to a cross-domain write.

## The arithmetic, not the hardware The question of how many failure domains to spread across is answered by counting, not by comparing data-centre brochures. Two things in a cluster are decided by majority: on platforms where a write commits once a majority of a partition's copy set holds it, and in the small membership that holds cluster metadata and admits every structural change. **Majority means strictly more than half.** Everything about the two-domain trap follows from that one definition. Split an even number of members or copies evenly across two domains and each domain holds exactly half. Lose either one, and the survivor holds exactly half — which is not more than half. The layout looks maximally symmetric and is, in majority terms, the worst arrangement available: it converts any single domain failure into a loss of majority. ## Counting it out | Layout | Held in each domain | After losing one domain | |---|---|---| | Two domains, even split (2/2 or 3/3) | half and half | exactly half survives — no majority either way | | Two domains, uneven split (3/2) | majority in the larger | survives losing the small one, fails losing the large one | | Three domains (2/2/1 or 1/1/1) | roughly a third each | about two thirds survive — a majority whichever domain went | The uneven two-domain row is worth dwelling on. It is not a fix; it is a bet on which domain fails. A cluster arranged that way has a coin-flip outcome, and the failure you get is chosen by the world rather than by you. ## Why the third domain can be small A third domain does not have to be a third of the machine. Its job is arithmetic: - it makes the total odd, so an even split becomes impossible; - it ensures that after any single domain loss, the surviving two domains together hold strictly more than half; - it needs to hold a member of the membership, or a copy, that can be counted — not a full share of the traffic. That is why a third rack, a small third building, or a third location that holds one tie-breaking member is a normal shape. The rule you are satisfying is: **no single power or network domain holds a majority of a copy set, or of the membership holding cluster metadata.** ## Both halves of the cluster, not one The same rule applies twice over, and teams routinely apply it once: 1. **Copies of each partition** are spread so no domain holds enough of the copy set to stop it being served. 2. **The membership holding cluster metadata** is spread on exactly the same principle, because a cluster whose data survived a domain loss but whose metadata membership did not has survived the failure and cannot react to it. A layout where the record-serving nodes are neatly spread across three domains and the metadata membership sits in one of them is a three-domain cluster for reads and a one-domain cluster for change. ## Where the model varies Not every platform commits writes by majority, and the arithmetic has to be read against the design in front of you: - **Majority-commit copy sets** are the clean case: half is never enough, and the table above applies directly. - **A leading copy with followers that must be caught up** does not count a majority at all; it counts against a floor of caught-up copies that somebody configured. A domain loss that drops the caught-up set below that floor stops writes just as effectively, so the placement question is the same one asked with a different number. - **Shared storage under the record-serving nodes** removes per-node copies entirely, and the domain question moves to how that storage system is spread — it does not disappear. - **Platforms whose metadata is held by a separate coordination service** still have a membership needing a majority; it simply is not made of the same machines, and it needs spreading on its own. - **A rented cluster** may place across domains for you and give you no visibility into it at all; then the question to ask the vendor is how many domains, not which racks. ## The half-fix to recognise Two domains plus an accepted manual intervention is a legitimate engineering position — someone decides, out of band, which surviving domain is allowed to proceed. It is legitimate because it is explicit, and it is expensive because it needs a human who is awake, correct and fast. What is not legitimate is an even two-domain split that nobody has noticed is one, described in a design document as "highly available across two sites". And the standing constraint does not go away: a third domain further from the other two adds a network hop to any write that must reach it before being acknowledged. That is why the third domain is usually placed as close as it can be while still failing independently.

  • Does an uneven split across two domains solve it?
    No — it relocates the problem. A three-and-two split survives losing the smaller domain and loses its majority when the larger one goes, so the outcome depends on which domain failed. That is a bet, not a design, and the failure you get is not the one you choose.
  • Does a third domain have to carry a third of the traffic?
    No. Its function is to make the total odd and to keep any single domain below a majority, so it may hold one member or a small share of copies. Sizing it like the others is a reasonable choice for load balance, but the arithmetic does not require it.
  • What if the platform commits writes on caught-up copies rather than a majority?
    The same placement question is asked against a different number. A domain loss that drops the caught-up set below the configured floor stops writes, so copies are still spread so no domain holds enough of the set to take writes out with it.

A committee that decides by majority is split evenly between two rooms. Cut the line between the rooms and neither side can claim a majority — each is exactly half, and both are stuck being reasonable at each other. Put one extra member in a third room and the arithmetic settles itself: whichever room goes dark, the rest are still more than half, and they can act.

saying these in an interview costs you the question

  • says two domains are enough because each one holds half
  • thinks an even split leaves a majority after one domain is lost
  • assumes the surviving half promotes itself back into a majority
  • insists the third domain must be the same size as the others
  • spreads copies across three domains but leaves the metadata membership in one
  • treats an uneven two-domain split as a real fix