And other friends
  1. Consensus Algorithm that is easier to understand than Paxos
  2. Leader Election:
    • Every node can become a leader
    • Every node has an election timeout (randomised value within a set interval)
    • Once the election timeout occurs, the node becomes a candidate
    • Candidates send vote requests to all known nodes
    • Once the candidate receives the majority of votes, it becomes the Leader
    • The Leader sends heartbeat ("Append Log") messages to followers
    • If the replica has not received a heartbeat from the leader in its election timeout, it becomes a candidate, etc...
  3. Change Propagation:
    • Client sends a change to the leader
    • The change is appended to the leaders log
    • The change is sent to the followers in the next heartbeat
    • An entry is "committed" once the majority of followers acknowledge it
    • Once the entry is committed, the response is sent to the client
  4. Resilience:
    • In case of network partitions, raft separates into sub-clusters with their own leaders
    • A sub-cluster with the smaller number of nodes will be unable to commit transactions
    • When the network partition is healed:
      • The leader with the lower follower count (smaller) will step down
      • The smaller and all its followers will rollback their logs to match the bigger one
      • This guarantees preservation of log consistency in the face of network failures
Good guys cite sources
  1. Raft homepage: https://raft.github.io/
  2. Rust bay Area Meetup talks on Raft: https://onlinexperiences.com/scripts/Server.nxp
  3. Raft paper: https://raft.github.io/raft.pdf