Study Atlas › Computer Science › Distributed systems

Distributed systems: CAP theorem and consensus

Systems of networked computers that must cope with failures and agree on shared state.

Edited by Alex C, EduAlx · Sources cited below

Explanation

Brewer's CAP theorem (proved by Gilbert and Lynch, 2002): under a network partition, a system must choose between consistency and availability. Paxos (Lamport) and Raft (Ongaro and Ousterhout, 2014) achieve consensus with crash failures. MapReduce (2004) and Spark process big data across clusters.

Example

Google Spanner uses atomic clocks and Paxos for global consistency.

How it works, step by step

  1. Replicate data across nodes
  2. Leader proposes updates
  3. Majority acknowledges
  4. Commit and apply in order
  5. Elect a new leader on failure

Open the interactive page with diagrams →

People behind it

References

  1. S. Gilbert, N. Lynch, ACM SIGACT News 2002, 33(2), 51–59.
  2. J. Dean, S. Ghemawat, Proc. OSDI 2004, 137–150.
  3. D. Ongaro, J. Ousterhout, Proc. USENIX ATC 2014, 305–319.

Textbooks

Related topics

Blockchain and distributed ledgersComputer security fundamentals (CIA triad)Cloud computingHash functions and digital signaturesVirtualisation and containersWeb development: front end and back endFile systems and storageSearch engines and PageRankPipelining and parallel processorsComputer vision and convolutional neural networks