---
title: "ZGateway: Learnings from Putting a Proxy in Front of ZippyDB"
description: "ZGateway is a stateless regional proxy tier in front of ZippyDB, Meta's most widely used key-value store."
url: "https://swe.quest/articles/zgateway-learnings-from-putting-a-proxy-in-front-of-zippydb-e9677a1b8fb7de14"
canonical: "https://engineering.fb.com/2026/09/03/core-infra/zgateway-proxy-zippydb-meta/"
source: "Meta Engineering"
published: "2026-09-03"
difficulty: "medium"
kind: "Case study"
reading_minutes: 13
tags: ["distributed-databases","load-balancing","resilience","scalability","multi-tenancy"]
---

# ZGateway: Learnings from Putting a Proxy in Front of ZippyDB

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2026-09-03, 13 min read, Case study. Original: [https://engineering.fb.com/2026/09/03/core-infra/zgateway-proxy-zippydb-meta/](https://engineering.fb.com/2026/09/03/core-infra/zgateway-proxy-zippydb-meta/)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Distributed databases](https://swe.quest/tags/distributed-databases.md) (Data & databases)
- [Load balancing](https://swe.quest/tags/load-balancing.md) (Infrastructure)
- [Resilience](https://swe.quest/tags/resilience.md) (Distributed systems)
- [Scaling](https://swe.quest/tags/scalability.md) (Distributed systems)
- [Multi-tenancy](https://swe.quest/tags/multi-tenancy.md) (Architecture & design)

## Prerequisites

- key-value store basics
- RPC and connection pooling ([easy posts on RPC & gRPC](https://swe.quest/tags/rpc.md?difficulty=easy))
- load shedding concepts ([easy posts on Resilience](https://swe.quest/tags/resilience.md?difficulty=easy))
- sharding and replication ([easy posts on Distributed databases](https://swe.quest/tags/distributed-databases.md?difficulty=easy))

## Keywords

ZGateway, ZippyDB, ServiceRouter, Thrift, Discriminant Load Shedding, AIMD, change data capture

## Related posts

- [How Meta built the infrastructure for Threads](https://swe.quest/articles/how-meta-built-the-infrastructure-for-threads-961a6b509998fe97.md): Meta Engineering · 2023-12-19 · Medium · 7 min read · Scaling, Distributed databases, Multi-tenancy, Serverless, Resilience
  Threads 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.
- [The Best Multi-Region Hosting Platforms in 2026](https://swe.quest/articles/the-best-multi-region-hosting-platforms-in-2026-fbed8cd7b315a007.md): Railway · 2026-05-25 · Easy · 13 min read · Cloud platforms, Distributed databases, Replication, System design
  "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).
- [Rapidly scaling online storage to serve over 1 billion ChatGPT users (Part II)](https://swe.quest/articles/rapidly-scaling-online-storage-to-serve-over-1-billion-chatgpt-users-part-ii-1fe17c5ac1f7349f.md): OpenAI · 2026-10-23 · Medium · 18 min read · Multi-tenancy, Distributed databases, Scaling, Capacity planning, Cloud platforms
  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.
- [How we built a general purpose key value store for Facebook with ZippyDB](https://swe.quest/articles/how-we-built-a-general-purpose-key-value-store-for-facebook-with-zippydb-852970eb82fe8238.md): Meta Engineering · 2021-08-06 · Hard · 10 min read · Distributed databases, Replication, Consistency models, Consensus, Multi-tenancy
  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.
- [Scale without limits: Multigres, OrioleDB, and dbarena](https://swe.quest/articles/scale-without-limits-multigres-orioledb-and-dbarena-9dcab6dd01f060fc.md): Supabase · 2026-10-02 · Easy · 4 min read · PostgreSQL, Storage engines, Replication, Performance engineering
  Supabase 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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
