0 day streak

Raft is a way for a small group of servers, usually three or five, to agree on one shared log of commands even when some of them crash, so together they act like a single reliable machine. Time is split into numbered terms, and in each term at most one server is the leader, elected by winning votes from a majority. Clients send commands to the leader, which appends them to its log and copies them to the followers; an entry counts as committed once a majority has stored it. If the leader goes quiet, a follower times out and calls an election. Because any two majorities share at least one server, and voters reject candidates whose logs are behind their own, a new leader always holds every committed entry. etcd and Consul are built on Raft.

In this lesson: A full simulation: kill the leader, partition the cluster, and watch terms and logs.