Practice this topic in a realistic system design interview
Consensus algorithms have a reputation for being hard to implement correctly. Paxos is especially hard to turn into clean working code. Raft was designed to be easier to understand and easier to build.
Raft is a consensus algorithm for building a replicated log. In plain English, it gives a group of servers one agreed order of commands, even when some servers crash, restart, or fall behind.
Each server applies that same command sequence to its local state machine. If the same command always produces the same result, every server ends up with the same state.
Raft gets there with a few practical choices:
Systems such as etcd, Consul, CockroachDB, TiKV, Vault, and Kafka's KRaft metadata group use Raft or Raft-inspired protocols for their critical replicated state.
This chapter covers how Raft elects a leader, copies log entries, and keeps committed data safe.