Software Design

Understanding Raft Consensus Node State Machine

State Diagrams · made in Skemio

State diagram of Raft consensus showing initial state to Follower, transition to Candidate on timeout, promotion to Leader on quorum, and transitions back to Follower on higher term.
State diagram of Raft consensus showing initial state to Follower, transition to Candidate on timeout, promotion to Leader on quorum, and transitions back to Follower on higher term.

What it shows

  • Nodes start as Followers listening for periodic Leader heartbeats.
  • Heartbeat timeouts trigger Candidate state and a new term election.
  • Securing majority votes promotes a Candidate to authoritative Leader.

The takeaway

Raft guarantees consistency by electing exactly one leader per term via quorum.

More state diagrams