What Raft solves
Raft keeps a replicated log consistent across a cluster even when nodes crash. It was designed to be understandable, splitting consensus into leader election, log replication, and safety.
Leader election
Time is divided into numbered terms. Each node is a follower, candidate, or leader. If a follower hears no heartbeat from a leader before its randomized election timeout, it becomes a candidate, increments the term, and asks for votes. A candidate that wins a majority becomes leader.
Log replication
The leader accepts client commands, appends them to its log, and sends them to followers. An entry is committed once a majority store it. Only then is it applied to the state machine and acknowledged to the client.
Safety
Raft only elects candidates whose log is at least as up to date as a majority, so committed entries are never lost. The term numbers let nodes reject stale leaders, preventing two leaders in the same term.
Why it stays simple
Randomized timeouts make split votes rare and quick to resolve. Strong leadership means all changes flow one direction, which is easier to reason about than peer to peer schemes.
Key idea
Raft achieves consensus by electing a single strong leader per term and committing log entries only after a majority of nodes replicate them.