Raft consensus
Studies in this cluster, in series order. Each one keeps its own URL.
Distributed systems
Raft consensus, replication, consistent hashing, saga-style distributed transactions, two-phase commit, and conflict-free replicated data types.
Raft consensus
5 studies- 1.Raft Consensus — Leader Election, Log Replication & SafetySingle leader, append-only log, commit after majority; terms/roles/heartbeats/log matching vs Multi-Paxos; used in etcd/Consul/TiKV/K8s metadata.
- 2.Quorums & Majority — Why 2f+1, Read Quorums & Stale ReadsN=2f+1 tolerates f crashes; majority intersection prevents conflicting commits; linearizable reads need ReadIndex/lease not blind follower reads.
- 3.Leader Election Deep Dive — Timeouts, Randomized Election, Split VotesHeartbeat silence → new-term election via RequestVote; exclusive votes + up-to-date log; randomized timeouts; pre-vote reduces disruption.
- 4.Log Replication & Commit Index — Matching, Conflict Resolution & SafetyAppendEntries + prevLog match; nextIndex backoff; truncate divergent suffixes; commitIndex on majority current-term matchIndex (Figure 8); safety sketch.
- 5.Raft vs Multi-Paxos vs Zab — When to Choose WhatSame CFT RSM goal, different models/ops/ecosystems; prefer Raft/etcd/Consul greenfield; keep ZK when watches own estate; custom Multi-Paxos only with deep expertise.