20 Raft 1 Commit
Raft
- Distributed Consensus over a RSM
- A quorum (majority of nodes in a cluster) protocol
- Leader Election
- Log
- No CFG, no Primary Server (No single point of failure)
Client Interaction
- Client can contact any server in the raft cluster
- The server points client to the leader
- Client must submit operations to the leader, then await response
- If server says 'OK', operation will not be lost, guarantees strong consistency
Raft Log
- Contains every operation to replicate the system (RSM)
- Contains term (Era/Yuan Nian, guarantees only 1 leader at a give time), and index (position of entry in log)
Application state: current data or situation inside the program that’s using Raft.
Process
- Client submit operation
- Leader saves operation to Log
- Leader propagate new log entry to all other server via
AppendEntries - If the majority responded to leader, commit and respond to client
OK
Commit Index
- Kept by all servers (leader & follower)
- Keeps track of all committed entries on the server
- Updated by the leader (when majority has concensus, which means that this data could never be lost)
- Leader propagates commitindex regularly via
AppendEntry

Even if one server fails, majority still agrees
