Basic Paxos Protocol Design

Learn how the Paxos algorithm achieves consensus.

Paxos is a consensus algorithm. We all are well aware of the notion of consensus from a common situation—a group of people deciding on a food place for lunch. In the field of computer science, Paxos helps multiple processes agree on a single value from multiple proposed values. It has various applications in distributed systems where multiple nodes work together and need to make a common decision for various purposes.

The goal of the Paxos algorithm is to eventually decide on one value.

Working of Paxos

When a group of people is deciding on a place to have lunch, there are usually three types of people involved. Some are knowledgeable about restaurants and will suggest places, some will agree with the suggestions of others, and some will wait for the final decision without providing any input. In Paxos, these roles are given the names proposers, acceptors, and learners.

Roles

Let's define these roles below:

Proposers: Proposers send their proposals to the other replica group members. Each proposer tries to have the majority of members to support their proposal. Clients hand over commands to one of the proposers, which initiates the Paxos algorithm to get the client's value accepted.

Acceptors: Acceptors are the group members who receive proposals and accept or reject them.

Learners: Learners keep track of accepted values. When the same value has been accepted at a majority, the consensus is achieved and these commands are then marked as chosen. The local state machine can execute that specific command.

Note: We will assume that each replica plays all three roles of proposer, acceptor, ...

Access this course and 1400+ top-rated courses and projects.