Research papers and 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
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 · PDF · Meta post Describes memcache as a demand-filled look-aside cache and introduces leases against stale sets and thundering herds. Used in: The cache-aside pattern, Cache invalidation, Redis cache in Node.js, Database caching with PostgreSQL, Cache stampede and the thundering herd, Distributed cache system design, How Discord, Meta, Uber and others handle caching
- Yang, Yue and Rashmi. "A large scale analysis of hundreds of in-memory cache clusters at Twitter." OSDI 2020. Paper page · PDF Analyzes traces from 153 Twemcache clusters and reports on write-heavy workloads, TTLs, popularity skew and FIFO against LRU. Used in: Caching strategies, How Discord, Meta, Uber and others handle caching
- Yang, Zhang, Qiu, Yue and Rashmi. "FIFO queues are all you need for cache eviction." SOSP 2023. Paper · 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. Used in: LRU cache and eviction policies
- Zhang, Yang, Yue, Vigfusson and Rashmi. "SIEVE is Simpler than LRU: an Efficient Turn-Key Eviction Algorithm for Web Caches." NSDI 2024. Paper page · Project site Presents SIEVE, an eviction algorithm with one queue, one pointer and one bit per object, where a hit only sets a bit. Used in: LRU cache and eviction policies
- Vattani, Chierichetti and Lowenstein. "Optimal Probabilistic Cache Stampede Prevention." Proceedings of the VLDB Endowment 8(8), VLDB 2015. PDF Gives optimal algorithms for probabilistic early expiration, where a request randomly asks for a regeneration before the item expires. Used in: Cache stampede and the thundering herd, How Discord, Meta, Uber and others handle caching
- Einziger, Friedman and Manes. "TinyLFU: A Highly Efficient Cache Admission Policy." arXiv, 2015. arXiv 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. Used in: LRU cache and eviction policies
- 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 Introduces consistent hashing, a hash function that changes minimally as its range changes, for caching protocols that relieve hot spots. Used in: Distributed cache system design, How Discord, Meta, Uber and others handle caching
- Nottingham. "RFC 5861: HTTP Cache-Control Extensions for Stale Content." May 2010. RFC Defines the stale-while-revalidate and stale-if-error Cache-Control extensions, which allow a cache to use a stale response. Used in: Cache stampede and the thundering herd, How Discord, Meta, Uber and others handle caching
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 Describes data services that coalesce requests for the same row and a consistent hash route by channel ID. Used in: How Discord, Meta, Uber and others handle caching
- Meta Engineering, "Scaling memcache at Facebook" (2013). Post A short introduction by two of the paper's authors that links to the NSDI paper. Used in: How Discord, Meta, Uber and others handle caching
- Uber, "How Uber Serves Over 40 Million Reads Per Second from Online Storage Using an Integrated Cache". Post Describes CacheFront, a cache-aside layer on Redis for Docstore, with invalidation from the MySQL binlog. Used in: The cache-aside pattern, Cache invalidation, Database caching with PostgreSQL, How Discord, Meta, Uber and others handle caching
- Slack, "Flannel: An Application-Level Edge Cache to Make Slack Scale". Post Describes an edge cache that serves startup data and queries, with consistent hashing for team affinity. Used in: How Discord, Meta, Uber and others handle caching
- Cloudflare, "Sometimes I cache: implementing lock-free probabilistic caching". Post Compares a cache lock with a probabilistic die-roll revalidation and relates it to the VLDB 2015 paper. Used in: Cache stampede and the thundering herd, How Discord, Meta, Uber and others handle caching
- AWS Builders' Library, "Caching challenges and strategies". Article Covers local and external caches, inline and side caches, expiration, soft and hard TTLs, negative caching and request coalescing. Used in: Redis cache in Node.js, Caching in Node.js, Distributed cache system design, How Discord, Meta, Uber and others handle caching
- Netflix EVCache. Repository A memcached-based caching solution whose name stands for Ephemeral, Volatile, Cache. Used in: How Discord, Meta, Uber and others handle caching
- Twitter Pelikan. Repository Twitter's framework for developing cache services. Used in: How Discord, Meta, Uber and others handle caching
- Meta mcrouter. Repository 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. Used in: Distributed cache system design, How Discord, Meta, Uber and others handle caching
- Shopify IdentityCache. Repository
Read-through ActiveRecord caching on Memcached that expires objects from an
after_commithook. Used in: Cache invalidation, Database caching with PostgreSQL, How Discord, Meta, Uber and others handle caching
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.
- Caffeine (Java). Repository 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. Used in: LRU cache and eviction policies
- FusionCache (.NET). Repository 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. Used in: How Discord, Meta, Uber and others handle caching
- BentoCache (Node.js). Repository 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. Used in: Caching in Node.js
- groupcache (Go). Repository 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. Used in: Distributed cache system design, How Discord, Meta, Uber and others handle caching
- singleflight (Go). Package Provides a duplicate function call suppression mechanism, so only one execution is in flight for a given key at a time. Used in: Cache stampede and the thundering herd, How Discord, Meta, Uber and others handle caching
- lru-cache (Node.js). Repository
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,ttlormaxSize. Used in: LRU cache and eviction policies, Caching in Node.js
Documentation
Vendor and project documentation for the commands and patterns the lessons use.
- Redis, SCAN. Docs Iterates the keyspace incrementally, and a given element may be returned more than once. Used in: Delete Redis keys by pattern
- Redis, KEYS. Docs Finds keys by pattern in O(N) time, and the page says not to use it in regular application code. Used in: Delete Redis keys by pattern
- Redis, UNLINK. Docs Removes keys like DEL but reclaims the memory in a different thread, so it does not block. Used in: Delete Redis keys by pattern
- Redis, client-side caching reference. Docs Explains keeping replies in application memory and receiving invalidation messages from the server. Used in: Redis cache in Node.js, Delete Redis keys by pattern, Caching in Node.js
- AWS ElastiCache, caching strategies for Memcached. Docs Covers lazy loading, write-through and adding a TTL, with the advantages and disadvantages of each. Used in: Caching strategies, The cache-aside pattern
- Microsoft Azure Architecture Center, Cache-Aside pattern. Docs Loads data on demand into a cache from a data store, and contrasts this with caches that provide read-through and write-through. Used in: Caching strategies, The cache-aside pattern
- PostgreSQL, resource consumption. Docs
Documents
shared_buffers, which defaults to about 128 MB, and notes that PostgreSQL also relies on the operating system cache. Used in: Database caching with PostgreSQL - Varnish, grace mode and keep. Docs Explains serving an object for some time after its TTL has expired while a new version is fetched, and request coalescing for concurrent requests. Used in: How Discord, Meta, Uber and others handle caching
- microservices.io, Transactional outbox. Pattern Stores the message in the database first, and a separate process then sends it to the message broker. Used in: Cache invalidation, How Discord, Meta, Uber and others handle caching
Learning resources
Talks, tables and guides for going deeper.
- Jeff Dean, "Designs, Lessons and Advice from Building Large Distributed Systems." LADIS 2009 keynote. Slides Slides with a storage hierarchy that lists DRAM at 100 ns and disk at 10 ms. Used in: What is caching?
- "Latency Numbers Every Programmer Should Know." Gist A table of latencies from an L1 cache reference at 0.5 ns to a disk seek at 10 ms. Used in: What is caching?
- Martin Fowler, "Two Hard Things." Page Collects Phil Karlton's saying that there are only two hard things in computer science, cache invalidation and naming things, and its variations. Used in: Cache invalidation
- Umer Mansoor, "Caching Strategies and How to Choose the Right One." CodeAhoy, 2017. Article Explains cache-aside, read-through, write-through, write-around and write-back. Used in: Caching strategies
- Hello Interview, "Caching for System Design Interviews." Guide Covers cache architectures, eviction policies, stampedes, consistency and hot keys from an interview angle. Used in: What is caching?, Caching strategies, Redis cache in Node.js
How Discord, Meta, Uber and others handle caching
How Discord stores messages, how Facebook memcache avoids stale sets, how Uber serves 40M reads a second: the caching at scale patterns each one wrote about.
Walkthrough
Follow one key through a cold load, a peer read, a database update, and a Redis outage.