Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Meta Engineering 13 min read Case study hardMaster

Introducing Zelos: A ZooKeeper API leveraging Delos

Meta built Zelos, a ZooKeeper-compatible service on top of the Delos replicated-shared-log platform, to replace ZooKeeper clusters whose design ties application state to the ZAB consensus protocol and resists scaling changes. ZooKeeper's session semantics required new mechanisms. A SessionOrderingEngine speculatively pipelines appends, detects rare reorderings through node and proposal IDs, and reissues commands to keep strict per-session order. A two-level Local/Global Session Manager provides leaderless session leases. TimeKeeper is a tick-based protocol over log positions that detects LSM failure without synchronized clocks. One LSM heartbeat covers all of its sessions, which makes session tracking cheaper than ZooKeeper's per-session leader tracking, and the GSM engine is reusable by other Delos apps.

Assumes: state machine replicationZooKeeper sessions and ephemeral nodeslinearizabilityshared log consensus

Related posts

  • ClickHouse Keeper: A ZooKeeper alternative written in C++

    ClickHouse mediumAdept

    ClickHouse Keeper is a C++ drop-in replacement for ZooKeeper with the same client protocol and data model. It adds better snapshot and log compression, no 1 MB node size limit, no ZXID overflow, faster partition recovery, and optional linearizable reads, and it is continuously validated with Jepsen tests. Measurements from loading WikiStat data into a 3-node ClickHouse Cloud service show how cluster size, part-size settings and data volume drive Keeper traffic, about 70% of which is multi-write transactions. A reusable keeper-bench-suite built on EC2, cAdvisor and Prometheus reproduces this workload and finds Keeper uses up to 46x less memory than ZooKeeper with comparable performance.

  • Bonree replaces ZooKeeper with ClickHouse Keeper for drastically improved performance and reduced costs

    ClickHouse hardMaster

    Bonree migrated the coordination layer of its ClickHouse-based observability platform from five 3-node ZooKeeper clusters to a single ClickHouse Keeper cluster. The move cut CPU and memory use by more than 75% and improved performance nearly 8x, and it eliminated Java full-GC stalls and replica sync backlogs. The migration was automated with Ansible: ingestion and merges are stopped (e.g. SYSTEM STOP MERGES), fresh snapshots are taken and converted, then data is sampled and verified, bringing a 2-3 hour manual process down to minutes. Bonree also modified clickhouse-keeper-converter to merge snapshots from multiple ZooKeeper clusters into one, handled mixed ACL encryption states, and replaced slow ZooKeeper path reads with a path log, cutting verification of 9 million paths from about 9 hours to seconds.

  • How we built a general purpose key value store for Facebook with ZippyDB

    Meta Engineering hardMaster

    ZippyDB is Facebook's largest strongly consistent, geo-distributed key-value store, built by layering a reusable replication library (Data Shuttle) on RocksDB, Shard Manager and a ZooKeeper-based config service. Shards of 50–100 GB hold tens of thousands of μshards, enabling transparent resharding. Each shard keeps a small Multi-Paxos quorum plus async follower replicas, with epoch-based leader leases assigned externally. Consistency is chosen per request: fast-ack or quorum writes, and eventual (actually bounded-staleness), read-your-writes or lease-based strong reads. Serializable transactions use optimistic concurrency control on the primary within an epoch, and conditional writes reuse that machinery server-side.

  • Choosing QuePaxa, an unusual consensus algorithm

    Cloudflare hardMaster

    Cloudflare's Meerkat, a globally distributed consensus service for its internal control plane, uses QuePaxa instead of Raft or Multi-Paxos. Leader-based protocols stall over wide-area networks: mistaken or slow fault detection triggers leader elections, and competing candidates can interfere destructively and cause metastable failures. QuePaxa avoids this with an optional leader, no reliance on fault detection, and randomized priorities that make proposers converge on the highest-priority proposal. It still decides in one round trip through the leader in good conditions and degrades gracefully otherwise. Its hedging timeout is not fault detection, so it can be very small (e.g., 5ms on 100ms links) without freezing the system.

  • Deno KV internals: building a database for the modern web

    Deno hardMaster

    Deno KV's production backend runs on FoundationDB, with a custom "transaction layer" in front of it that handles multi-tenant configuration, JavaScript-native types such as bigint sums, and cross-region replication. To keep latency low, every atomic operation is non-interactive: a single bag of versionstamp checks, set/delete writes and conflict-free mutations that completes in one or two network trips. A sequencer assigns monotonic transaction sequence numbers, and an evaluator turns each batch into a dataflow graph of AND/MUX operations and evaluates it concurrently. Results are reused speculatively before a writer commits them to FoundationDB, which raises throughput without locks.

The quest for software engineering knowledge.

Look:
Layout: