Consensus is an algorithm in distributed systems that forces agents in the system to agree on consistent values and elect a leader.

Some well-known consensus algorithms are Paxos and Raft. Paxos and Raft deliver similar performances but Raft is less complex, easier to understand, and therefore becoming very popular in distributed store implementations.

As consensus algorithms, Consul and Etcd implement Raft while ZooKeeper implements Paxos. The CoreOS Etcd Go library, implementing Raft, is included into SwarmKit and Swarm Mode as a dependency (in vendor/), so in this book we'll focus more on it.

Raft is described in detail in the Ongaro, Ousterhout paper, and it is available at https://ramcloud.stanford.edu/raft.pdf. In the upcoming section ...

Get Native Docker Clustering with Swarm now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.