Raft Distributed Consensus

State machine replication

Goal: Create a fault-tolerant distributed algorithm that enables a set of processes to agree on a sequence of events.

Distributed Consensus

Why do we need consensus?

Ref: https://pk.org/classes/417/notes/raft.html

Raft

image

Consensus Goal

image

image

image

Implementation

States

image

RPCs

image

Terms

image

Leader Election

image

Server State transitions

image

Heartbeat and Timeout

image

image

image

Log Replication

image

image

image

image

Possible logs of followers

image

image

image

how does a server learn about a newly elected leader?

Timeline

image

Invariants

image

Log compaction and Snapshot

image

Summary

image

source: https://www.hashicorp.com/resources/raft-consul-consensus-protocol-explained

Ref: