Is a Consesus Protocol created by Leslie Lamport in 1989, and it is used in multiple Graph Database Systems like neo4j. It is also used in 📜 Cassandra for leader election.
Algorithm:
There are 3 roles:
- Proposers - wants to propose value v an wants the system to reach consensus on this value. Sends a prepare(id) to all acceptors and expects a promise -> value response. Upon reception:
- If the majority (quorum) sends a promise with a null value, the proposer sends an accept(id, v). If he receives again the majority of the responses with the id and v, consensus has been achieved for value v
- If
- If the proposer doesn't get the majority number of promise responses, it will try again with a higher id
- Acceptors
- Listeners