---
title: "How we built a general purpose key value store for Facebook with ZippyDB"
description: "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."
url: "https://swe.quest/articles/how-we-built-a-general-purpose-key-value-store-for-facebook-with-zippydb-852970eb82fe8238"
canonical: "https://engineering.fb.com/2021/08/06/core-infra/zippydb/"
source: "Meta Engineering"
published: "2021-08-06"
difficulty: "hard"
kind: "Case study"
reading_minutes: 10
tags: ["distributed-databases","replication","consistency","consensus","multi-tenancy"]
---

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

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2021-08-06, 10 min read, Case study. Original: [https://engineering.fb.com/2021/08/06/core-infra/zippydb/](https://engineering.fb.com/2021/08/06/core-infra/zippydb/)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Distributed databases](https://swe.quest/tags/distributed-databases.md) (Data & databases)
- [Replication](https://swe.quest/tags/replication.md) (Distributed systems)
- [Consistency models](https://swe.quest/tags/consistency.md) (Distributed systems)
- [Consensus](https://swe.quest/tags/consensus.md) (Distributed systems)
- [Multi-tenancy](https://swe.quest/tags/multi-tenancy.md) (Architecture & design)

## Prerequisites

- Paxos basics ([easy posts on Consensus](https://swe.quest/tags/consensus.md?difficulty=easy))
- consistency models ([easy posts on Consistency models](https://swe.quest/tags/consistency.md?difficulty=easy))
- key-value stores
- sharding ([easy posts on Distributed databases](https://swe.quest/tags/distributed-databases.md?difficulty=easy))

## Keywords

ZippyDB, RocksDB, Data Shuttle, Multi-Paxos, Shard Manager, Akkio, ZooKeeper

## Related posts

- [Deno KV internals: building a database for the modern web](https://swe.quest/articles/deno-kv-internals-building-a-database-for-the-modern-web-61dddae321d95df6.md): Deno · 2023-09-14 · Hard · 10 min read · Distributed databases, Consistency models, Storage engines, JavaScript
  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.
- [Announcing Deno KV](https://swe.quest/articles/announcing-deno-kv-d97d28c9a7128cf3.md): Deno · 2023-05-01 · Medium · 5 min read · Databases, Consistency models, Replication, JavaScript
  Deno KV is a strongly consistent key-value database built into the Deno runtime.
- [RAMP-TAO: Layering atomic transactions on Facebook’s online graph store](https://swe.quest/articles/ramp-tao-layering-atomic-transactions-on-facebook-s-online-graph-store-470552a388260a08.md): Meta Engineering · 2021-08-18 · Hard · 2 min read · Consistency models, Distributed databases, Caching, Distributed systems
  RAMP-TAO is a protocol that layers read-atomic transactional guarantees on top of TAO, Facebook's eventually consistent social graph store, so developers get an intuitive read transaction API without handling fractured-read anomalies.
- [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.
- [ZGateway: Learnings from Putting a Proxy in Front of ZippyDB](https://swe.quest/articles/zgateway-learnings-from-putting-a-proxy-in-front-of-zippydb-e9677a1b8fb7de14.md): Meta Engineering · 2026-09-03 · Medium · 13 min read · Distributed databases, Load balancing, Resilience, Scaling, Multi-tenancy
  ZGateway is a stateless regional proxy tier in front of ZippyDB, Meta's most widely used key-value store.

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)
