
The Raft Consensus Algorithm - ForHackernews
http://raftconsensus.github.io/
======
krat0sprakhar
One of the most lucid explanations of the Raft Consensus Algorithm that I've
ever seen is the one in John Ousterhout and Diego Ongaro's Raft User Study[0].
The 2 videos do an excellent job of explaining both the Paxos and Raft
algorithms and the key differences between them. John's narration is extremely
clear and the slides are very informative. Definitely recommended!

 _Raft is a consensus algorithm designed to be easier to understand than
Paxos. To measure Raft 's understandability, we conducted an experimental
study using CS students at two universities. We recorded a video lecture of
Raft and another of Paxos, and created corresponding quizzes. This page makes
our materials available for anyone interested. We think these are valuable
resources for anyone learning consensus (whether Raft or Paxos or both)._

[0] -
[https://ramcloud.stanford.edu/~ongaro/userstudy/](https://ramcloud.stanford.edu/~ongaro/userstudy/)

Raft Video -
[https://www.youtube.com/watch?v=YbZ3zDzDnrw](https://www.youtube.com/watch?v=YbZ3zDzDnrw)

Paxos Video -
[http://www.youtube.com/watch?v=JEpsBg0AO6o&feature=youtu.be](http://www.youtube.com/watch?v=JEpsBg0AO6o&feature=youtu.be)

~~~
icedog
Directly to the results:
[https://ramcloud.stanford.edu/~ongaro/userstudy/graphs.pdf](https://ramcloud.stanford.edu/~ongaro/userstudy/graphs.pdf)

------
tedsuo
The only issue I have with raft (besides bugs in the various implementations I
have to deal with at work) is that it is not yet proven to truly be simpler
than Paxos. In other words, is it a genuinely simpler algorithm that provides
the the same guarantees as Paxos, or is it simpler because it leaves edge
cases unspecified, forcing implementors to grind through the edge cases with
heuristics? If it's the second, it's not actually simpler, it's just worse.

I'm not saying that it isn't genuinely simpler. Just that in discussions about
raft, I see most people blindly assuming that it is. But I don't believe that
it has been proven yet. I think this is the nuclear power plant part of the
bikeshed discussion. [1]

If you scrub to the 50 minute mark of this talk[2] by Leslie Lamport (creator
of Paxos), my coworker David Varvel asks him this question and he gives more
or less the same answer.

[1]
[http://en.wikipedia.org/wiki/Parkinson's_law_of_triviality](http://en.wikipedia.org/wiki/Parkinson's_law_of_triviality)
[2]
[http://channel9.msdn.com/Events/Build/2014/3-642](http://channel9.msdn.com/Events/Build/2014/3-642)

~~~
justinsb
Is there a good open-source Paxos implementation? There are many open-source
Raft implementations, some of which are good. goraft powers etcd, for example.

I believe most developers just want to consume a working library. It seems
likely that the plethora of Raft libraries and dearth of Paxos libraries is
because it is easier to write a Raft library, but I also don't think it
matters _why_, it only matters that there are good Raft libraries.

~~~
tedsuo
CoreOs (etcd team) is currently rewriting their raft implementation because it
had a lot of problems. I don't believe there is a "good" implementation out
there yet, because it's all very new. And should an implantation be "good",
AKA implement the spec without introducing incidental errors, will it still
have edge cases because the spec has edge cases? This is all currently
unknown. It's precisely these assumptions that I'm pointing out.

A quick google search brings up libpaxos and other open paxos implementations,
so it appears that they exist.

~~~
alexnewman
If you are looking for a good one. Checkout ours [https://github.com/cloud-
software-foundation/c5-replicator](https://github.com/cloud-software-
foundation/c5-replicator)

~~~
justinsb
Wow - this looks like a great implementation. Who is cloud-software-
foundation? Is this the software that powers WANdisco?

~~~
alexnewman
This does not power wandisco. WanDISCO uses DConE.

------
penguindev
This is pretty awesome and I think only real hardcore folks who need time-
guaranteed leader failover (like, I don't know, a heart pacemaker or
something) would stick with paxos. (Assuming paxos can provide that).

~~~
penguindev
hmm, actually watching the paxos video posted above - even basic paxos needs
randomized delays to avoid livelock with multiple proposers. ouch. so why
would people choose it over raft?

------
brunoqc
Can the Raft Consensus works with only two nodes?

~~~
antirez
Technically speaking, it should work, however it is no longer available during
partitions since the only 2 nodes partition creates two minority partitions,
so the algorithm can't promote a new leader, nor make progresses since new log
entries can't reach the majority. Basically you have the same properties using
a single node without consensus, if not for the data redundancy. However it is
not something like: one node dies, the other can continue. TLDR: 3 nodes is
the practical minimum.

------
wcummings
The RAFT paper is incredibly comprehensible, and clearly written with an
audience of engineers in mind (it even specs out signatures for RPC calls).
Definitely worth a read, if you have't read it already.

I saw a good talk about RAFT given by a Basho engineer, video and slides are
here: [http://www.meetup.com/Erlang-
NYC/events/131394712/](http://www.meetup.com/Erlang-NYC/events/131394712/)

The speakers Erlang implementation:
[https://github.com/andrewjstone/rafter](https://github.com/andrewjstone/rafter)

------
pavpanchekha
Have the authors seen [
[http://en.wikipedia.org/wiki/Paxos_(computer_science)](http://en.wikipedia.org/wiki/Paxos_\(computer_science\))
](PAXOS)? It seems related.

~~~
jbp
PAXOS is very complicated, Raft is direct response to it by simplifying the
consensus algorithm. From the article:

    
    
      "It's equivalent to Paxos in fault-tolerance and performance. The difference is that it's decomposed into relatively independent subproblems, and it cleanly addresses all major pieces needed for practical systems."
    

One of the authors of Raft is Prof. John Ousterhout(TCL creator, among other
things)

