Skip to content
INTERNET INFRASTRUCTURE & NETWORKS

Cloudflare Unveils Experimental Distributed Consensus Service ‘Meerkat’ Powered by Novel QuePaxa Algorithm

Cloudflare has officially announced Meerkat, an experimental distributed consensus service designed to manage its internal global control plane. Moving away from industry-standard protocols, Meerkat is powered by QuePaxa, a novel consensus algorithm published in 2023 by researchers Tennage and Băsescu et al. While traditional distributed systems rely heavily on well-established algorithms like Raft, Multi-Paxos, or Viewstamped Replication, Cloudflare’s global scale and unique network constraints necessitated a radically different architectural approach to ensure uninterrupted service across continents.

Most common consensus systems are well-understood, feature mature implementations, and perform reliably within tightly controlled environments. However, they frequently struggle when deployed across wide-area networks (WANs) characterized by volatile connectivity and unpredictable latency, such as the public Internet where Meerkat operates. Traditional protocols inherently rely on a single designated leader process remaining continuously available and exhibiting predictable network latency. If this leader goes down, experiences anomalous latency, or gets temporarily disconnected from the cluster, the entire consensus system slows down dramatically or becomes entirely unavailable until a new leader can be successfully elected and instated. For a global infrastructure provider like Cloudflare, such widespread operational stalls are entirely unacceptable.

What We’re Building and Why It’s Unique

At its core, Meerkat is a distributed system wherein a network of replicas must agree upon an ordered log of events, with each entry explicitly determined by a consensus algorithm. Distributed consensus allows a group of independent machines to agree on a single, shared source of truth, even when a subset of those machines unexpectedly crashes or disconnects from the network. The foundational guarantee of any robust consensus algorithm is that participating machines will never decide on conflicting values, thereby ensuring that the event logs of all Meerkat replicas never diverge.

Meerkat utilizes this consensus-powered log to expose high-level applications, such as a distributed key-value (KV) store, where individual entries in the log correspond directly to database operations like a get or a put. Because the underlying consensus algorithm guarantees that replica logs remain strictly synchronized, every node independently constructs an identical key-value state. Comparable consensus-powered systems frequently utilized across the industry include Consul, etcd, and Apache ZooKeeper.

Unlike these similar systems, however, Meerkat was intentionally designed from the ground up for global scale. A standard Meerkat cluster may be distributed across multiple continents, interconnected by network links that frequently exhibit high and highly variable latency. This setup stands in stark contrast to conventional consensus deployments, which are typically restricted to localized data centers and maintain strict, low-latency networking requirements.

The Challenges of Consensus at a Global Scale

While all consensus algorithms guarantee that replicas eventually agree on the same value, many of them suffer from disproportionate unavailability or severe performance degradation when underlying network conditions deteriorate, even if no physical machines actually crash. Cloudflare has experienced this vulnerability firsthand. In 2020, the partial failure of a core network switch caused a consensus-powered system to degrade significantly, causing internal dashboards to operate eighty times slower than usual for a grueling six-hour period. While the system fortunately suffered no permanent data loss, it became entirely unavailable for write operations until the issue was manually resolved—an operational failure mode that engineers are eager to prevent in the future.

Ideally, a modern consensus algorithm should maintain steady progress despite sudden latency spikes and broken physical connections, rather than folding under pressure when non-fatal network anomalies occur. This resilience is particularly vital at a global scale, where faults are far more likely to originate within the complex web of external routing infrastructure rather than within Cloudflare’s own proprietary servers.

To understand why traditional systems falter under these conditions, it helps to examine two common traits of legacy consensus algorithms: destructive interference during proposal rounds and error-prone fault detection.

Destructive Interference and Leaders

Consider Paxos, the foundational ancestor of nearly all modern consensus algorithms. Many subsequent protocols inherit both the beneficial structural elements and the problematic quirks of Paxos. Abstractly, the system comprises two primary types of processes: proposers and acceptors. The overarching goal is for a majority of acceptors to agree on a specific value submitted by a proposer through a two-phase process known as the Prepare phase and the Accept phase.

During the Prepare phase, any active proposer can broadcast a numbered ballot out to a majority of acceptors. This ballot number acts as a formal promise: acceptors agree to accept only proposals associated with that specific ballot number or higher. Subsequently, during the Accept phase, the proposer broadcasts its actual proposal alongside the ballot number. If a majority of acceptors still hold that corresponding ballot number, they accept the proposal, allowing the proposer to safely finalize the decision.

Complications arise when two or more proposers attempt to submit competing proposals concurrently. A competing proposer can interleave a higher ballot number in between the two phases of another proposer, effectively blocking any lower ballots. If multiple proposers do this simultaneously, they can repeatedly block each other from making progress, effectively locking up the system in a perpetual loop of competing proposals.

When proposers compete and block one another in this fashion, engineers refer to the phenomenon as destructive interference. This interference worsens as the number of active proposers increases, elevating the likelihood that the system will stall indefinitely. Formally, classical Paxos does not guarantee liveness—the certainty that proposals will eventually be decided—without assuming that all network messages will arrive within a bounded timeframe, an assumption known as partial synchrony.

To mitigate this constant competition, most deployed consensus systems introduce a special leader proposer. The leader acts as the sole replica authorized to make proposals, centralizing proposing power, enforcing a strict order on concurrent requests, and enabling decisions to be reached in an optimal single network round-trip. While the leader remains healthy and network conditions remain favorable, leader-based protocols are exceptionally fast. However, the inherent trade-off is that the leader must remain fully operational and reachable. When it fails, slows down, or gets disconnected, the entire system stalls until remaining replicas detect the failure and elect a replacement.

When Leader Recovery is Unstable

When a leader inevitably fails, the distributed system must recover by electing a successor. Ironically, the leader recovery mechanism is frequently how destructive interference manages to sneak right back into an otherwise stable leader-based system.

Consider the Raft protocol. To preserve safety, Raft elects a new leader using a majority vote. A replica that suspects the leader has failed announces itself as a leadership candidate and requests votes from its peers. If more than half of the replicas grant their support, the candidate assumes leadership. If consensus is not reached, a new election is called.

Because multiple replicas can independently detect a leader failure and launch concurrent candidacies, these candidates frequently compete for the same majority vote. This introduces the exact same destructive interference seen in Paxos: multiple replicas can mutually prevent each other from securing majority support. The longer elections fail, the more candidates throw their hats into the ring, exacerbating the congestion.

Even after the original leader recovers from a transient issue, elections can continue to disrupt normal system functioning. This creates what computer scientists call a metastable failure—a failure pattern that perpetuates itself long after the initial root cause has been removed. A brief two-second network glitch can trick the system into thinking a leader has died, triggering a messy election cycle that outlasts the actual network outage by a significant margin.

Choosing QuePaxa, an unusual consensus algorithm

When Fault Detection Goes Awry

The problem of destructive interference during leader elections is further compounded by trigger-happy fault detectors, particularly across volatile wide-area networks. For a leader-based system to initiate recovery, replicas must first accurately detect that the current leader has failed. However, because processes in a distributed network cannot directly observe the internal state of a remote machine, they must rely entirely on indirect observations, such as missing heartbeats or delayed acknowledgments.

In asynchronous networks like the Internet, messages do not always arrive within predictable timeframes. There is no guaranteed upper bound on network transit times. Consequently, if a server fails to reply within a predetermined window, other nodes cannot definitively distinguish whether the server has actually crashed or if the network has merely experienced a temporary latency spike.

Practicing fault detectors must make an educated guess based on elapsed time, and those guesses are occasionally wrong. If a detector mistakenly assumes a healthy leader has failed, it triggers an unnecessary election, forcing the entire system to grind to a halt until the recovery process concludes. Furthermore, even accurate fault detectors must be configured with conservative timeouts to avoid false positives, meaning that detecting a genuine failure in a high-latency global network can take upwards of a full second of complete system downtime.

Why QuePaxa is the Right Fit

Recognizing that any consensus algorithm reliant on strict leadership or accurate timeout heuristics would inevitably stall across the Internet, Cloudflare searched for protocols specifically designed for asynchronous environments. This search led directly to QuePaxa, a 2023 academic breakthrough by Tennage and Băsescu et al.

The defining characteristic of QuePaxa is its ability to reach consensus efficiently in a single round trip under optimal conditions, while gracefully degrading performance during severe latency spikes, connectivity losses, or server crashes. QuePaxa achieves this resilience through three foundational design choices: an optional leader, a total reliance on constructive interference rather than competition, and the complete elimination of traditional fault detection mechanisms.

In QuePaxa, the roles are split between proposers, which submit desired values, and recorders, which act as neutral intermediaries recording every proposal they observe. Rather than forcing proposers to aggressively compete for acceptance, QuePaxa assigns a randomized priority number to each proposal. The optional leader is simply assigned an exclusive, maximum possible priority.

During execution, proposers submit their payloads to recorders, which propagate the information across the cluster. If a proposer receives a proposal from a recorder bearing a higher priority than its own, it immediately adopts the higher-priority proposal as its own and begins broadcasting it. Consequently, proposers cooperate rather than conflict, driving the system toward the highest priority proposal collectively known.

While non-leader proposers rely on randomized priorities that make convergence probable within a given round, the system guarantees eventual consensus given enough rounds. Crucially, the designated leader is completely optional. While the leader enjoys a fast path allowing it to finalize decisions in a single round-trip, clients are never forced to route requests through it. If the leader goes down, clients seamlessly continue making requests to alternative proposers without triggering a disruptive system-wide election.

To exploit this fast-path efficiency without creating a single point of failure, clients hedging their bets send proposal requests to every replica simultaneously. Non-leader replicas wait for a brief local hedging timeout, granting the leader an opportunity to process the request quickly if it is healthy. This hedging timeout is fundamentally different from Raft’s election timeouts: it does not rely on fault detection, is not constrained by network latency, and can be tuned locally by each replica without freezing the cluster.

How QuePaxa Works Under the Hood

QuePaxa operates through structured rounds comprising four distinct phases. If a proposal is not successfully decided during the final phase, a new round is initiated. At the beginning of each phase, proposers broadcast their currently adopted proposal to all recorders. Once a proposer receives replies from a majority of recorders, it advances to the next phase.

The first phase, often called the Leader Fast Path, randomizes priorities to satisfy the FLP impossibility theorem while checking whether the leader has successfully secured majority support. Because the leader’s proposal carries the absolute maximum priority, a leader that reaches a majority of recorders first can decide immediately. This remains entirely safe due to the mathematical property of majority intersection: any two majorities of recorders always share at least one common recorder, ensuring that any subsequent proposer querying a majority will inevitably encounter and adopt the leader’s higher-priority proposal.

When multiple proposers contend concurrently, the fast path may be blocked, initiating the concurrent slow path. In subsequent phases, proposers spread their adopted proposals, and recorders track the highest-priority options observed. This staged propagation ensures that the protocol can never inadvertently finalize a lower-priority proposal. Even if individual rounds fail to reach a final decision, the protocol’s cooperative design ensures that all proposers converge on the best known proposal heading into each successive round, making consensus exponentially easier to achieve as rounds progress.

How QuePaxa Makes Meerkat Possible

In empirical evaluations of Meerkat deployed across servers spanning nearly all global continents, Cloudflare observed firsthand the profound operational impact of the QuePaxa algorithm. Meerkat continuously processes incoming control plane requests even when the designated leader experiences artificial crashes, sudden disconnections, or severe latency degradation. At no point during testing did the system experience a complete operational stall.

The rate at which Meerkat handles requests has proven remarkably predictable. Upwards of 95% of all consensus decisions are successfully finalized by the leader during the first phase, maintaining stable throughput. In rare instances where a decision spills over into subsequent phases, throughput drops momentarily to roughly one-third of its normal capacity as the system requires three round-trips to finalize agreement. While performance slows down temporarily, the system never grinds to a halt.

Furthermore, QuePaxa enables engineers to dynamically hot-swap which replica acts as the cluster leader while production traffic is actively flowing. Because the leader is not an exclusive gatekeeper and proposers cooperate organically, temporary leader misconfigurations no longer threaten total cluster stability.

What Comes Next

Choosing to implement an unconventional, cutting-edge protocol like QuePaxa required taking a less-traveled path. Because the algorithm lacks the decades of widespread battle-testing enjoyed by Raft or Paxos, and because Cloudflare is actively extending its original crash-stop design to support full crash recovery, the engineering effort demands rigorous verification.

To ensure absolute correctness, Cloudflare is formally verifying its Rust-based implementation of QuePaxa and Meerkat, backed by extensive simulation and automated fault-injection testing. Future technical updates from the engineering team will detail the formal verification methodology, failure-injection stress tests, performance benchmarks, and broader lessons learned in transforming an academic distributed consensus protocol into a resilient production-grade infrastructure system.