---
title: "Cache made consistent"
description: "Meta raised TAO's cache consistency from six nines to ten nines (99.99999999% of cache writes consistent within five minutes) by treating consistency as a measurement and debugging problem rather than only a protocol problem."
url: "https://swe.quest/articles/cache-made-consistent-61a6d7479b73ae8d"
canonical: "https://engineering.fb.com/2022/06/08/core-infra/cache-made-consistent/"
source: "Meta Engineering"
published: "2022-06-08"
difficulty: "medium"
kind: "Case study"
reading_minutes: 13
tags: ["caching","consistency","observability","distributed-systems","debugging"]
---

# Cache made consistent

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

## Summary

Meta raised TAO's cache consistency from six nines to ten nines (99.99999999% of cache writes consistent within five minutes) by treating consistency as a measurement and debugging problem rather than only a protocol problem. Polaris acts as a client that consumes invalidation events and checks cache replicas against client-observable invariants. It uses multi-timescale retry queues and defers expensive cache-bypass database reads, which avoids false positives without overloading the database. A stateful consistency-tracing library logs cache mutations only in the short window after a write, where fills and invalidations race. That gave engineers complete timelines for bugs such as a versioned entry that stayed stale indefinitely.

Written by swe.quest, not by the author.

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

## Topics

- [Caching](https://swe.quest/tags/caching.md) (Backend & APIs)
- [Consistency models](https://swe.quest/tags/consistency.md) (Distributed systems)
- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [Distributed systems](https://swe.quest/tags/distributed-systems.md) (Distributed systems)
- [Debugging](https://swe.quest/tags/debugging.md) (Engineering practices)

## Prerequisites

- cache invalidation ([easy posts on Caching](https://swe.quest/tags/caching.md?difficulty=easy))
- eventual consistency ([easy posts on Consistency models](https://swe.quest/tags/consistency.md?difficulty=easy))
- distributed caching ([easy posts on Caching](https://swe.quest/tags/caching.md?difficulty=easy))

## Keywords

TAO, Memcache, Polaris, Meta

## Related posts

- [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.
- [A Deep Dive into PolyScale’s Architecture](https://swe.quest/articles/a-deep-dive-into-polyscale-s-architecture-4fc7b2915489e809.md): Neon · 2023-12-18 · Medium · 11 min read · Caching, PostgreSQL, CDN & edge, Performance engineering
  PolyScale is a wire-protocol proxy cache that sits between an application and its database (here, Neon serverless Postgres), routing connections to the nearest edge PoP and caching query results with TTLs it learns automatically from arrival rate, result change rate and related "query templates".
- [Protocol-Aware Deterministic Simulation Testing](https://swe.quest/articles/protocol-aware-deterministic-simulation-testing-7f3b613be8faf2a6.md): TigerBeetle · 2026-08-20 · Hard · 10 min read · Formal methods, Testing, Consensus, Replication, Storage engines
  TigerBeetle's deterministic simulator (the VOPR) has full visibility into each replica's consensus and storage state, so it can check invariants that black-box tools like Jepsen or Antithesis cannot see through user-facing APIs.
- [Turso v0.5.0](https://swe.quest/articles/turso-v0-5-0-1bc59038f4941e8d.md): Turso · 2026-03-04 · Hard · 6 min read · SQLite, Storage engines, Query engines, Consistency models, Search
  Turso v0.5.0 promotes MVCC-based concurrent writes (BEGIN CONCURRENT, adapted from Hekaton) to beta.
- [Slack’s Incident on 2-22-22](https://swe.quest/articles/slack-s-incident-on-2-22-22-7a35cde32cfb5fd8.md): Slack Engineering · 2022-04-26 · Medium · 12 min read · Incidents & postmortems, Caching, Resilience, MySQL, Distributed systems
  A Consul agent rolling restart caused Mcrib, Slack's memcached control plane, to replace and flush cache nodes, dropping hit rates during peak traffic.

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)
