Multi-Raft Consensus
NodeDB uses Multi-Raft — each vShard is its own independent Raft group with its own leader, log, and snapshot schedule. This avoids the bottleneck of a single Raft group for the entire cluster.
Per-vShard Raft
Each Raft group handles:
- Leader election — automatic failover when the current leader becomes unreachable
- Log replication — WAL entries replicated to followers before acknowledgement
- Snapshots — periodic state snapshots to truncate the Raft log
Write Path (Replicated)
- Client sends write to the vShard leader
- Leader appends to local WAL
- Leader replicates to Raft followers
- Quorum acknowledges (majority of replicas)
- Leader commits and responds to client
Writes are linearizable within each Raft group.
Advantages of Multi-Raft
- Independent leaders — different vShards can have leaders on different nodes, distributing write load
- Parallel commits — vShards commit independently, no global ordering bottleneck
- Granular failover — a node failure only triggers leader election for the vShards it led, not the entire cluster