Definition · Majority, and fault toleranceA majority of n nodes is any subset of size ⌊n/2⌋ + 1. A cluster that requires a majority to make progress tolerates f = ⌊(n − 1)/2⌋ failures, and the relation is usually written n = 2f + 1: to tolerate f, buy 2f + 1 nodes.
The intersection property is the reason for all of it. Two majorities of the same n must share a node, by the same pigeonhole argument that “Quorums Overlap” proved, so a node that has voted for one decision can refuse a conflicting one. Nothing else about a majority is special — it is simply the smallest quorum that overlaps itself.
each node up with probability 99/100, failures independent
A = P(at least the majority are up), a k-of-n binomial tail
n majority f A
1 1 0 99%
2 2 0 98.01%
3 2 1 99.9702%
4 3 1 99.940797%
5 3 2 99.99901494%
6 4 2 99.998044641%
7 4 3 99.99996583302%
f rises only on the odd sizes, and A falls on every even one
Read down the f column and the design rule falls out: 3, 5, 7. The even sizes are transitional — they carry the cost of the next size up and the tolerance of the one below. That is why production clusters are almost always odd, and why the advice is repeated so often that its reason gets lost.
Why the fourth node makes it worse
n = 3, majority 2
A = C(3,2)(99/100)²(1/100) + (99/100)³
= 3(9801/10 000)(1/100) + 970 299/1 000 000
= 29 403/1 000 000 + 970 299/1 000 000
= 999 702/1 000 000 = 99.9702%
n = 4, majority 3
A = C(4,3)(99/100)³(1/100) + (99/100)⁴
= 4(970 299/1 000 000)(1/100) + 96 059 601/100 000 000
= 3 881 196/100 000 000 + 96 059 601/100 000 000
= 99 940 797/100 000 000 = 99.940797%
one more node, the same f, and 0.029403 points LESS availability
The arithmetic is not a curiosity, it is the direct consequence of needing three specific things to work instead of two. Availability of a k-of-n system falls as k rises and rises as n does, and the even step raises k by one while raising n by one — and at 99% per node the first effect wins.
Example · Where the next real step isFrom three nodes, the upgrade is five, not four. Five tolerates two failures instead of one and is available 99.99901494% of the time against 99.9702% — a factor of about thirty in the downtime, for two more machines. Four tolerates one failure and is available 99.940797%, which is worse than the three it replaced. If the budget allows one more node and not two, the right answer is to keep three and spend the money on making a node's own availability better, because that is the quantity every figure in this table is a function of.
Every number here assumes failures are independent, and Availability and Failure's “Correlated Failure” exists to say how badly that can go. Three nodes in one rack share a switch, a power feed and an operator; the majority arithmetic is then describing a cluster that does not exist and the real availability is closer to one node's. Spreading the 2f + 1 across failure domains is what makes the independence assumption approximately true, and it is the whole reason to care where the nodes are.