Caching
Where caches sit, cache-aside reads and writes, how caches learn of change, and what goes wrong under load.
4 lessons
Where and how to cache
- 1Cache layers and where a cache sitsWhere a copy lives decides who shares it, how stale it can get, and who can delete it.
- 2Cache-aside and the read and write pathsThe database is the truth; the cache is whatever was written to it last. Delete after the commit, and the next read restores the truth.
- 3How caches learn of changeA cache learns of change only through a path you build. Cover every writer, and keep a TTL for when a path fails.