Caching · TL;DR
1 min readRapid overview
TL;DR
A cache trades correctness for speed, and every interesting question about caching is really a question about how much staleness the read can tolerate. The mechanics — where the cache sits, which write strategy you use, how entries are evicted — are secondary to that judgement. The two failure modes worth knowing cold are the stampede, where an expiring hot key sends thousands of simultaneous requests to the database, and the hot key, where one item's traffic exceeds what a single cache node can serve; both have standard fixes, and neither is solved by making the cache bigger.