Skip to Content

Ensure exactly one node is the leader at a time; if it fails, elect a new one.

Data Flow (Raft)

  Follower --(election timeout)--> Candidate
                          |
  votes from majority of nodes
                          |
                          v
                       Leader
       
 leader sends heartbeats; followers revert if miss heartbeat

Algorithms

Pitfalls

Analogy

A meeting with one chair: when the chair leaves, the longest-standing member takes it; if they all leave, the next arrival becomes chair.

Interview tip: Mention Raft by name — it’s the algorithm interviewers want you to describe.

Advertisement