
ZGateway: Learnings from Putting a Proxy in Front of ZippyDB
Meta introduced ZGateway, a stateless proxy tier for ZippyDB, its most widely-used key-value store. The proxy unifies traffic to reduce connection sprawl and improve system reliability and management.
Why it matters
By decoupling clients from database hosts, ZGateway prevents system-wide crashes caused by connection storms and allows Meta to manage traffic for millions of hosts centrally. This ensures more stable service for the products relying on ZippyDB metadata and configuration.
The details
Discriminant Load Shedding (DLS) prevents one misbehaving tenant from starving others. A control-plane balancer adjusts host weights to prevent hot outliers. Cross-region resilience allows traffic to fail over to healthy regional tiers. The proxy currently carries about 40% of all ZippyDB traffic.
What's next
Meta plans to unify all ZippyDB traffic through ZGateway and explore AI-operated heuristics for automated tuning.
Show entities and relationshipsHide entities and relationships
In this article
Key connections
ZippyDB, Meta’s most widely-used key value store
We’re introducing ZGateway, the proxy we are using to unify traffic through ZippyDB
Meta owns ServiceRouter
ServiceRouter, Meta’s hyperscale service mesh solution
ZGateway is related to ZippyDB
ZGateway, the proxy we are using to unify traffic through ZippyDB
ZGateway is related to ZServer
ZGateway is a stateless proxy tier between ZippyDB clients and the database (ZServer) fleet
ZGateway uses ServiceRouter
It runs as regional tiers discovered through ServiceRouter
Show 4 more connectionsShow fewer connections
ZGateway uses Load Balancing
it also enables admission control, load balancing, cross-region resilience
A client sends a request over its sticky connection to a regional ZGateway host, which terminates TLS
Some responsibilities deliberately stay put — TLS in the Thrift/ServiceRouter stack
ZGateway uses Discriminant Load Shedding
ZGateway’s defense is Discriminant Load Shedding (DLS)
Get the weekly recap
The stories like this one, picked and explained — once a week, straight to your inbox.