ZGateway: Learnings from Putting a Proxy in Front of ZippyDB
ZGateway is a stateless regional proxy tier in front of ZippyDB, Meta's most widely used key-value store. It handles over 1 billion ops/sec and about 40% of ZippyDB traffic at roughly 6% compute overhead. It collapses the direct client-to-database connection mesh, cutting per-host connection counts by about 97–98% in a balls-into-bins model and making database fan-in independent of client population. Cross-client batching and coalescing amortize RPC overhead and neutralize hot keys. The shared tier also hosts per-tenant discriminant load shedding, CDC-invalidated read caching, CPU-weighted load balancing, cross-region failover and transaction bookkeeping for thin clients.
Related posts
- How Meta built the infrastructure for Threads
Meta Engineering mediumAdeptThreads reached 100 million sign-ups in five days on existing shared Meta infrastructure rather than purpose-built systems, illustrated through two components: ZippyDB and Async. ZippyDB, a multi-tenant key/value store, absorbs sudden demand by shifting unused allocations and slack between keyspaces via config changes. It scales out with a zero-downtime resharding protocol that remaps logical shards to new physical shards, which let the team proactively prepare Threads keyspaces for 100x growth just before launch. Async (XFaaS), a serverless deferred-execution platform, queued the far-higher-than-expected follow-graph imports and notification jobs and rate-limited their execution to protect downstream services such as the social graph database.
- The Best Multi-Region Hosting Platforms in 2026
Railway easyNovice"Multi-region" covers three distinct problems: CDN static asset distribution (level 1), stateless compute in multiple regions with a single-region database (level 2), and multi-region writes for stateful data (level 3). Most teams need level 2 but believe they need level 3, which costs roughly an order of magnitude more in money and engineering complexity and requires application changes like idempotency keys and conflict semantics. Ten platforms are ranked against this framework, from Railway, Fly.io and Cloudflare for level 2 to AWS DynamoDB Global Tables/Aurora Global, Google Spanner, Azure Cosmos DB and CockroachDB for level 3, each with pricing and trade-offs.
- Rapidly scaling online storage to serve over 1 billion ChatGPT users (Part II)
OpenAI mediumAdept
OpenAI's Habitat storage platform went from one shared Azure Cosmos DB container, to per-use-case dedicated containers, and back to a shared multi-tenant container. Shared containers suffered from logical partition key collisions, noisy neighbors on physical partitions, and "weak partitions" whose throughput shrank as storage-driven splits divided fixed RU/s. Dedicated containers fixed isolation but lost the smoothing effect of aggregate load, which pushed capacity planning onto every product team and caused launch-day SEVs. Hot-key throttling, QoS request tiering and a new serverless mode built with Azure (10K RU/s per physical partition, plus RU-usage-based splits) made shared tenancy work. Failover and failback outages at 20M+ QPS scale also led to co-managed operations with Azure, including joint monitoring and production-sized test accounts.
- How we built a general purpose key value store for Facebook with ZippyDB
Meta Engineering hardMasterZippyDB 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.
- Scale without limits: Multigres, OrioleDB, and dbarena
Supabase easyNoviceSupabase launched three Postgres scaling efforts. Multigres, from the Vitess team, adds built-in connection pooling and automated failover across three availability-zone nodes, using a consensus protocol over synchronous replication so no committed write is lost. It is in private alpha. OrioleDB, in public beta, is a storage engine that replaces heap storage with a page-level undo log, removing bloat and the need for VACUUM, and uses 64-bit transaction IDs to avoid wraparound; it reports up to 1.8x heap throughput on TPC-C-derived benchmarks and can be chosen per table with USING orioledb. dbarena publishes reproducible, cost-normalized benchmarks comparing Supabase, RDS and Cloud SQL.