miniraft

The Raft consensus algorithm, running live in your browser. Nodes elect a leader, replicate a log, and recover when the network breaks. Click a node to cut it off; split the cluster and watch a minority stall while the majority keeps going. This page runs the exact same lib/ code as the library and its tests.

Leader Candidate Follower Cut off Pre-vote Vote request Log append

Each node shows its term and its log as colored blocks (one color per term). A ✓ marks committed entries. Click any node to toggle its network connection.

Cluster

Logical tick0
Leader—
Term0
Committed entries0
All nodes agreeyes

Event log

Built from scratch, zero dependencies — source on GitHub.

Raft (Ongaro & Ousterhout, 2014) keeps a replicated log consistent across machines even as some fail. This build also implements PreVote (§9.6): a cut-off node holds a pre-election before raising its term, so it never disrupts the cluster when it reconnects — cut a node off and watch its amber pre-votes go nowhere while the leader keeps running. The visualization is deterministic: the simulator is driven by a seeded PRNG, so every run is reproducible — the same property the test suite relies on.