Raft is the consensus algorithm behind systems like etcd, Consul and CockroachDB. Five servers form a cluster and must agree on a single, ordered log of commands even though any two of them can crash, restart, or get cut off by the network at any moment. Raft guarantees this by electing exactly one leader per term and requiring a majority (quorum) — 3 of these 5 nodes — to agree before anything is considered permanently committed.
Raft was designed in 2014 by Diego Ongaro and John Ousterhout at Stanford specifically to be easier to understand than its predecessor, Paxos, without sacrificing correctness — it is now one of the most widely deployed consensus algorithms in production systems.
A cluster of five simulated servers arranged in a ring elects a leader, replicates a growing log, and keeps agreeing on the same sequence of commands even as you crash nodes and cut the network.
Leader election via randomized timeouts and majority voting, log replication through AppendEntries messages, and the quorum rule that lets a 5-node cluster survive up to two simultaneous failures without losing data.
Click any node to crash or revive it, kill the leader outright, split the network into a 3/2 partition, propose new client writes, and tune election timeout and latency to see how they change election speed and stability.
Raft was designed in 2014 specifically to be more understandable than Paxos while offering the same fault-tolerance guarantees, and it now powers etcd, Consul, CockroachDB and countless other production systems.