Paxos and Raft
Learn about the Paxos and Raft consensus protocols.
We'll cover the following...
Basic Paxos
Paxos is a family of consensus algorithms that work in a distributed system. The Paxos algorithm was developed by Leslie Lamport and published in his 1998 paper, “The Part-Time Parliament.”
The host proposing a value is a proposer and the host accepting the proposal is an acceptor. Basic Paxos is the most basic consensus algorithm of the Paxos family. Basic Paxos has two phases, Phase 1 and Phase 2.
Phase 1
Phase 1 also has two subphases:
Prepare
Promise
In the prepare phase, the proposer creates a Prepare
message with a number X
, which is a unique identifier of the message and greater than any of the previous Prepare
messages from that proposer. Now, the proposer sends this message to a Quorum
of acceptor hosts.
Once the acceptor receives the message, there are two scenarios:
If ...