Part 2 of 5 · 1 min read
The consensus problem
Several nodes must agree on exactly one value, even if some nodes fail, propose different values, or are slow.
Think of a group of people trying to agree on one single restaurant for dinner. Some of them might suggest different places, and some might not respond in time. The rule is that everyone who does end up going must agree on the exact same restaurant.
In plain words: the consensus problem asks a set of nodes to agree on a single value, with the guarantee that every node that reaches a decision reaches the same decision, even if different nodes initially proposed different values, and even if some nodes fail or respond slowly during the process. A correct consensus protocol must satisfy this agreement guarantee no matter how the failures and timing happen to play out, which is precisely what makes it a hard problem rather than something solvable by simply picking whichever value arrives first.
A worked example. Three nodes each propose a different value as the next entry in a replicated log. A consensus protocol ensures that whichever value is eventually chosen, every node that commits an entry for that log position commits the exact same value, never two different ones.
The key lines. No new SQL; consensus is a distributed-systems-level guarantee, implemented by a protocol running beneath the database rather than expressed in SQL.
Consensus problem
The consensus problem is the problem of getting a set of nodes to agree on a single value, guaranteeing that every node reaching a decision reaches the same one, despite differing proposals, failures, or slow responses.
Example: a group agreeing on one single restaurant, with everyone who decides ending up agreeing on the same one, is a consensus problem.