Put open source to work
July 16–17, 2018: Training & Tutorials
July 18–19, 2018: Conference
Portland, OR

How unreliable computers can usually agree (sort of): A tour of the Raft algorithm

Laura Hampton (Independent)
2:35pm3:15pm Wednesday, July 18, 2018
Distributed computing
Location: Portland 255
Level: Intermediate
Average rating: ***..
(3.83, 6 ratings)

Who is this presentation for?

  • Software engineers, DevOps engineers, and those who work with container or database synchronization technologies

Prerequisite knowledge

  • A working knowledge of a programming language
  • No prior knowledge of distributed systems or consensus required

What you'll learn

  • Understand the problem of consensus and what problems consensus algorithms solve
  • Learn how the Raft algorithm works


Every day, the amount of data we store increases dramatically, and users demand high availability and low latency from the machines where it is stored. Single machines are prone to failure and in many cases can’t cope with high traffic demands. Distributed systems have become an increasingly common solution for these problems. They offer fault tolerance and resilience while allowing users to interact with what appears to be a single machine.

Laura Hampton discusses the difficulties in replicating data across multiple machines, explains how the Raft algorithm, used in Kubernetes and Docker Swarm, provides reasonable guarantees, and shares proposed solutions to the consensus problem (and why they work). Laura begins by introducing the problem of consensus and exploring naive solutions and the ways they can fail. She then leads a deep dive into the Raft algorithm, covering leader election, log replication, log compression, writing to stable storage, and procedures for changing cluster membership. Along the way, Laura details how Raft is used in practice, including where to locate cluster members, as well as some interesting adaptations to the algorithm used in MongoDB replica sets.

Photo of Laura Hampton

Laura Hampton


Laura Hampton is a New York-based Python developer. She is working on Warehouse, the next-generation Python package repository.