Cloudflare has introduced QuePaxa, a novel consensus algorithm designed to maintain progress without relying on a stable leader. Unlike traditional leader-based approaches, QuePaxa allows nodes to make progress despite leader failures, potentially reducing delays caused by leader election and recovery.

As previously reported by InfoQ, Cloudflare is using it in Meerkat, an experimental distributed consensus service intended to improve coordination across geographically distributed infrastructure. João Pedro Leite, research engineer at Cloudflare, Bob Halley, principal research engineer at Cloudflare, and James Larisch, research engineer at Cloudflare, acknowledge:

QuePaxa is an unusual choice; most consensus systems use well-established consensus algorithms like Raft, (Multi-)Paxos or Viewstamped Replication. These algorithms are well understood, have mature implementations, and usually work well. Unfortunately, common consensus algorithms often suffer in wide-area networks with volatile network connectivity and latency, i.e., networks like the Internet, which is where Meerkat runs.

Consensus algorithms enable a group of machines to agree on a shared value, even when some machines fail or become disconnected, ensuring that no machines make conflicting decisions.

Phase and round progression

Source: Cloudflare blog

QuePaxa operates in four phases per round. At each phase, proposers send their current proposals to all recorders and advance after receiving replies from a majority. They progressively adopt and spread the highest-priority proposals, then check whether there is sufficient agreement to decide on a value. If no decision is reached, they carry the best-known proposal into the next round. Leite, Halley, and Larisch add:

In our own evaluations of Meerkat, where we had servers spanning nearly all continents, we’ve directly experienced the impact that QuePaxa has on the overall performance and availability of the system. Meerkat continuously processes requests, even when the leader crashes, disconnects, or just becomes slow. At no point have we ever seen it completely stall. This is exactly what we wanted.

Relative decision rate

Source: Cloudflare blog

Unlike traditional consensus algorithms, QuePaxa does not depend on a functioning leader to make progress. Any node can propose a value, and a short, configurable timeout allows other nodes to take over proactively without waiting to detect a leader failure. Manas Maheshwari, senior software engineer at Apex, comments on LinkedIn:

I think the real win here isn’t being leaderless for its own sake. It’s that a bad guess about failure costs throughput instead of availability. In a global network, slow and dead can look identical for long enough that the recovery logic becomes the outage. Falling back from one round trip to three without stopping feels like the right trade.

On Reddit, some users ask how Cloudflare avoids having multiple leaders participating in proposals. User leros writes:

I’m surprised we keep coming out with new and improved core stuff like consensus algorithms. I figured we would have optimized this stuff 10-20 years ago.

QuePaxa offers an alternative to leader-based consensus for maintaining availability in geographically distributed systems. The research paper behind the consensus algorithm is available on ACM.