# Research papers and references (https://layerscache.com/docs/learn/references)

> Caching research papers and references: Facebook memcache, Twitter, S3-FIFO, SIEVE, XFetch, consistent hashing, plus engineering posts and libraries.



This page lists every source cited in the Learn caching course, grouped by kind. Each entry has a link and, in italics, the lessons that use it. Descriptions come from the source itself, not from memory. None of the companies or authors listed here use or endorse lazy-layers-cache.

**Level:** all levels · Back to the [course overview](/docs/learn)

## Research papers [#research-papers]

Papers and standards, with authors, title, venue and year.

* **Nishtala, Fugal, Grimm, Kwiatkowski, Lee, Li, McElroy, Paleczny, Peek, Saab, Stafford, Tung and Venkataramani. "Scaling Memcache at Facebook." NSDI 2013.** [Paper page](https://www.usenix.org/conference/nsdi13/technical-sessions/presentation/nishtala) · [PDF](https://www.usenix.org/system/files/conference/nsdi13/nsdi13-final170_update.pdf) · [Meta post](https://engineering.fb.com/2013/04/15/core-infra/scaling-memcache-at-facebook/)
  Describes memcache as a demand-filled look-aside cache and introduces leases against stale sets and thundering herds.
  &#x2A;Used in:* [The cache-aside pattern](/docs/learn/cache-aside-pattern), [Cache invalidation](/docs/learn/cache-invalidation), [Redis cache in Node.js](/docs/learn/redis-cache-nodejs), [Database caching with PostgreSQL](/docs/learn/database-caching-postgres), [Cache stampede and the thundering herd](/docs/learn/cache-stampede), [Distributed cache system design](/docs/learn/distributed-cache-system-design), [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)
* **Yang, Yue and Rashmi. "A large scale analysis of hundreds of in-memory cache clusters at Twitter." OSDI 2020.** [Paper page](https://www.usenix.org/conference/osdi20/presentation/yang) · [PDF](https://www.usenix.org/system/files/osdi20-yang.pdf)
  Analyzes traces from 153 Twemcache clusters and reports on write-heavy workloads, TTLs, popularity skew and FIFO against LRU.
  &#x2A;Used in:* [Caching strategies](/docs/learn/caching-strategies), [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)
* **Yang, Zhang, Qiu, Yue and Rashmi. "FIFO queues are all you need for cache eviction." SOSP 2023.** [Paper](https://jasony.me/publication/sosp23-s3fifo.pdf) · [s3fifo.com](https://s3fifo.com/)
  Presents S3-FIFO, an eviction algorithm built from three static FIFO queues in which a hit only bumps a small counter and takes no lock.
  &#x2A;Used in:* [LRU cache and eviction policies](/docs/learn/lru-cache)
* **Zhang, Yang, Yue, Vigfusson and Rashmi. "SIEVE is Simpler than LRU: an Efficient Turn-Key Eviction Algorithm for Web Caches." NSDI 2024.** [Paper page](https://www.usenix.org/conference/nsdi24/presentation/zhang-yazhuo) · [Project site](https://cachemon.github.io/SIEVE-website/)
  Presents SIEVE, an eviction algorithm with one queue, one pointer and one bit per object, where a hit only sets a bit.
  &#x2A;Used in:* [LRU cache and eviction policies](/docs/learn/lru-cache)
* **Vattani, Chierichetti and Lowenstein. "Optimal Probabilistic Cache Stampede Prevention." Proceedings of the VLDB Endowment 8(8), VLDB 2015.** [PDF](https://www.vldb.org/pvldb/vol8/p886-vattani.pdf)
  Gives optimal algorithms for probabilistic early expiration, where a request randomly asks for a regeneration before the item expires.
  &#x2A;Used in:* [Cache stampede and the thundering herd](/docs/learn/cache-stampede), [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)
* **Einziger, Friedman and Manes. "TinyLFU: A Highly Efficient Cache Admission Policy." arXiv, 2015.** [arXiv](https://arxiv.org/abs/1512.00727)
  Proposes admitting a new item only when recent access history says it is worth more than the eviction candidate, and presents the W-TinyLFU policy.
  &#x2A;Used in:* [LRU cache and eviction policies](/docs/learn/lru-cache)
* **Karger, Lehman, Leighton, Panigrahy, Levine and Lewin. "Consistent Hashing and Random Trees: Distributed Caching Protocols for Relieving Hot Spots on the World Wide Web." STOC 1997.** [PDF](https://www.cs.princeton.edu/courses/archive/fall09/cos518/papers/chash.pdf)
  Introduces consistent hashing, a hash function that changes minimally as its range changes, for caching protocols that relieve hot spots.
  &#x2A;Used in:* [Distributed cache system design](/docs/learn/distributed-cache-system-design), [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)
* **Nottingham. "RFC 5861: HTTP Cache-Control Extensions for Stale Content." May 2010.** [RFC](https://www.rfc-editor.org/rfc/rfc5861)
  Defines the stale-while-revalidate and stale-if-error Cache-Control extensions, which allow a cache to use a stale response.
  &#x2A;Used in:* [Cache stampede and the thundering herd](/docs/learn/cache-stampede), [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)

## Engineering blogs and production systems [#engineering-blogs-and-production-systems]

What companies wrote about their own systems. A blog post describes one company's choices, not a rule for every system.

* **Discord, "How Discord Stores Trillions of Messages".** [Post](https://discord.com/blog/how-discord-stores-trillions-of-messages)
  Describes data services that coalesce requests for the same row and a consistent hash route by channel ID.
  &#x2A;Used in:* [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)
* **Meta Engineering, "Scaling memcache at Facebook" (2013).** [Post](https://engineering.fb.com/2013/04/15/core-infra/scaling-memcache-at-facebook/)
  A short introduction by two of the paper's authors that links to the NSDI paper.
  &#x2A;Used in:* [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)
* **Uber, "How Uber Serves Over 40 Million Reads Per Second from Online Storage Using an Integrated Cache".** [Post](https://www.uber.com/blog/how-uber-serves-over-40-million-reads-per-second-using-an-integrated-cache/)
  Describes CacheFront, a cache-aside layer on Redis for Docstore, with invalidation from the MySQL binlog.
  &#x2A;Used in:* [The cache-aside pattern](/docs/learn/cache-aside-pattern), [Cache invalidation](/docs/learn/cache-invalidation), [Database caching with PostgreSQL](/docs/learn/database-caching-postgres), [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)
* **Slack, "Flannel: An Application-Level Edge Cache to Make Slack Scale".** [Post](https://slack.engineering/flannel-an-application-level-edge-cache-to-make-slack-scale/)
  Describes an edge cache that serves startup data and queries, with consistent hashing for team affinity.
  &#x2A;Used in:* [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)
* **Cloudflare, "Sometimes I cache: implementing lock-free probabilistic caching".** [Post](https://blog.cloudflare.com/sometimes-i-cache/)
  Compares a cache lock with a probabilistic die-roll revalidation and relates it to the VLDB 2015 paper.
  &#x2A;Used in:* [Cache stampede and the thundering herd](/docs/learn/cache-stampede), [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)
* **AWS Builders' Library, "Caching challenges and strategies".** [Article](https://aws.amazon.com/builders-library/caching-challenges-and-strategies/)
  Covers local and external caches, inline and side caches, expiration, soft and hard TTLs, negative caching and request coalescing.
  &#x2A;Used in:* [Redis cache in Node.js](/docs/learn/redis-cache-nodejs), [Caching in Node.js](/docs/learn/nodejs-caching), [Distributed cache system design](/docs/learn/distributed-cache-system-design), [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)
* **Netflix EVCache.** [Repository](https://github.com/Netflix/EVCache)
  A memcached-based caching solution whose name stands for Ephemeral, Volatile, Cache.
  &#x2A;Used in:* [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)
* **Twitter Pelikan.** [Repository](https://github.com/twitter/pelikan)
  Twitter's framework for developing cache services.
  &#x2A;Used in:* [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)
* **Meta mcrouter.** [Repository](https://github.com/facebook/mcrouter)
  A memcached protocol router with hashing schemes, replicated pools and automatic failover, which its README says handles almost 5 billion requests per second at peak at Facebook and Instagram.
  &#x2A;Used in:* [Distributed cache system design](/docs/learn/distributed-cache-system-design), [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)
* **Shopify IdentityCache.** [Repository](https://github.com/Shopify/identity_cache)
  Read-through ActiveRecord caching on Memcached that expires objects from an `after_commit` hook.
  &#x2A;Used in:* [Cache invalidation](/docs/learn/cache-invalidation), [Database caching with PostgreSQL](/docs/learn/database-caching-postgres), [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)

## Libraries that solve the same problems [#libraries-that-solve-the-same-problems]

The README of each library is the source for these sentences. They show how other ecosystems handle the problems the lessons cover, and they are worth reading next to the [lazy-layers-cache API reference](/docs/reference/api).

* **Caffeine (Java).** [Repository](https://github.com/ben-manes/caffeine)
  An in-memory cache whose README lists size-based eviction based on frequency and recency, and names the TinyLFU paper among the research that presents its eviction policy.
  &#x2A;Used in:* [LRU cache and eviction policies](/docs/learn/lru-cache)
* **FusionCache (.NET).** [Repository](https://github.com/ZiggyCreatures/FusionCache)
  A hybrid L1 and L2 cache whose README lists cache stampede protection, a fail-safe that reuses an expired entry as a fallback, and eager refresh before expiration.
  &#x2A;Used in:* [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)
* **BentoCache (Node.js).** [Repository](https://github.com/Julien-R44/bentocache)
  A multi-tier cache for Node.js with an in-memory L1, a distributed L2, a bus that synchronizes instances, grace periods and stampede protection.
  &#x2A;Used in:* [Caching in Node.js](/docs/learn/nodejs-caching)
* **groupcache (Go).** [Repository](https://github.com/golang/groupcache)
  Coordinates cache fills so that only one load in one process of a replicated set populates the cache, then shares the loaded value with all callers.
  &#x2A;Used in:* [Distributed cache system design](/docs/learn/distributed-cache-system-design), [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)
* **singleflight (Go).** [Package](https://pkg.go.dev/golang.org/x/sync/singleflight)
  Provides a duplicate function call suppression mechanism, so only one execution is in flight for a given key at a time.
  &#x2A;Used in:* [Cache stampede and the thundering herd](/docs/learn/cache-stampede), [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)
* **lru-cache (Node.js).** [Repository](https://github.com/isaacs/node-lru-cache)
  A cache that deletes the least recently used items. Its README says it is not primarily a TTL cache and requires at least one of `max`, `ttl` or `maxSize`.
  &#x2A;Used in:* [LRU cache and eviction policies](/docs/learn/lru-cache), [Caching in Node.js](/docs/learn/nodejs-caching)

## Documentation [#documentation]

Vendor and project documentation for the commands and patterns the lessons use.

* **Redis, SCAN.** [Docs](https://redis.io/docs/latest/commands/scan/)
  Iterates the keyspace incrementally, and a given element may be returned more than once.
  &#x2A;Used in:* [Delete Redis keys by pattern](/docs/learn/redis-delete-keys-by-pattern)
* **Redis, KEYS.** [Docs](https://redis.io/docs/latest/commands/keys/)
  Finds keys by pattern in O(N) time, and the page says not to use it in regular application code.
  &#x2A;Used in:* [Delete Redis keys by pattern](/docs/learn/redis-delete-keys-by-pattern)
* **Redis, UNLINK.** [Docs](https://redis.io/docs/latest/commands/unlink/)
  Removes keys like DEL but reclaims the memory in a different thread, so it does not block.
  &#x2A;Used in:* [Delete Redis keys by pattern](/docs/learn/redis-delete-keys-by-pattern)
* **Redis, client-side caching reference.** [Docs](https://redis.io/docs/latest/develop/reference/client-side-caching/)
  Explains keeping replies in application memory and receiving invalidation messages from the server.
  &#x2A;Used in:* [Redis cache in Node.js](/docs/learn/redis-cache-nodejs), [Delete Redis keys by pattern](/docs/learn/redis-delete-keys-by-pattern), [Caching in Node.js](/docs/learn/nodejs-caching)
* **AWS ElastiCache, caching strategies for Memcached.** [Docs](https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/Strategies.html)
  Covers lazy loading, write-through and adding a TTL, with the advantages and disadvantages of each.
  &#x2A;Used in:* [Caching strategies](/docs/learn/caching-strategies), [The cache-aside pattern](/docs/learn/cache-aside-pattern)
* **Microsoft Azure Architecture Center, Cache-Aside pattern.** [Docs](https://learn.microsoft.com/en-us/azure/architecture/patterns/cache-aside)
  Loads data on demand into a cache from a data store, and contrasts this with caches that provide read-through and write-through.
  &#x2A;Used in:* [Caching strategies](/docs/learn/caching-strategies), [The cache-aside pattern](/docs/learn/cache-aside-pattern)
* **PostgreSQL, resource consumption.** [Docs](https://www.postgresql.org/docs/current/runtime-config-resource.html)
  Documents `shared_buffers`, which defaults to about 128 MB, and notes that PostgreSQL also relies on the operating system cache.
  &#x2A;Used in:* [Database caching with PostgreSQL](/docs/learn/database-caching-postgres)
* **Varnish, grace mode and keep.** [Docs](https://varnish-cache.org/docs/trunk/users-guide/vcl-grace.html)
  Explains serving an object for some time after its TTL has expired while a new version is fetched, and request coalescing for concurrent requests.
  &#x2A;Used in:* [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)
* **microservices.io, Transactional outbox.** [Pattern](https://microservices.io/patterns/data/transactional-outbox.html)
  Stores the message in the database first, and a separate process then sends it to the message broker.
  &#x2A;Used in:* [Cache invalidation](/docs/learn/cache-invalidation), [How Discord, Meta, Uber and others handle caching](/docs/learn/how-companies-cache)

## Learning resources [#learning-resources]

Talks, tables and guides for going deeper.

* **Jeff Dean, "Designs, Lessons and Advice from Building Large Distributed Systems." LADIS 2009 keynote.** [Slides](https://www.cs.cornell.edu/projects/ladis2009/talks/dean-keynote-ladis2009.pdf)
  Slides with a storage hierarchy that lists DRAM at 100 ns and disk at 10 ms.
  &#x2A;Used in:* [What is caching?](/docs/learn/what-is-caching)
* **"Latency Numbers Every Programmer Should Know."** [Gist](https://gist.github.com/jboner/2841832)
  A table of latencies from an L1 cache reference at 0.5 ns to a disk seek at 10 ms.
  &#x2A;Used in:* [What is caching?](/docs/learn/what-is-caching)
* **Martin Fowler, "Two Hard Things."** [Page](https://martinfowler.com/bliki/TwoHardThings.html)
  Collects Phil Karlton's saying that there are only two hard things in computer science, cache invalidation and naming things, and its variations.
  &#x2A;Used in:* [Cache invalidation](/docs/learn/cache-invalidation)
* **Umer Mansoor, "Caching Strategies and How to Choose the Right One." CodeAhoy, 2017.** [Article](https://codeahoy.com/2017/08/11/caching-strategies-and-how-to-choose-the-right-one/)
  Explains cache-aside, read-through, write-through, write-around and write-back.
  &#x2A;Used in:* [Caching strategies](/docs/learn/caching-strategies)
* **Hello Interview, "Caching for System Design Interviews."** [Guide](https://www.hellointerview.com/learn/system-design/core-concepts/caching)
  Covers cache architectures, eviction policies, stampedes, consistency and hot keys from an interview angle.
  &#x2A;Used in:* [What is caching?](/docs/learn/what-is-caching), [Caching strategies](/docs/learn/caching-strategies), [Redis cache in Node.js](/docs/learn/redis-cache-nodejs)
