EN
返回档案库

案例库 · 工程与运营 · 技术决策 · 2013–2014

这条还没译成中文,下面是英文原文。

Raft matched Paxos but was designed to be understood, so it won

Raft matched Paxos on safety and performance but deliberately made itself understandable, and so got more consensus systems built correctly.

Stanford University

那一手

Paxos was the accepted consensus algorithm, but it was hard to understand and hard to implement, so production systems built on it were prone to subtle bugs that only surfaced under leader failure.

Raft was written with a different priority: it is equivalent to Paxos in fault-tolerance and performance, and the difference is that it is designed to be easy to understand. Its authors broke consensus into a leader election, a log replicated in order, and a safety rule.

That separation is what let a wider audience implement it correctly. Understandability was treated as a first-class requirement, and the result was a consensus algorithm teams could actually reason about and ship.

为什么管用

  • Understandable phases map to what a programmer can verify.
  • Cleverness in consensus tends to breed implementation bugs.
  • Wider correct adoption beats a marginal performance edge.
值了多少Design the algorithm for the human who has to verify it神来之笔

可以搬走什么

When correctness depends on many others getting it right, make the hard thing easy to verify; a design that is merely clever costs more through bugs than it gains in elegance.

后来呢

Raft was adopted by etcd, Consul, CockroachDB and many other distributed systems, and became the default way engineers learn and build consensus.

资料来源

发现哪里写错了?告诉我们。

同一路聪明