Part 1 of 7 · 1 min read
Why this page comes first
In this module you will
- Explain what a cache is and why keeping a copy near the reader makes reads faster.
- Say what locality of reference means, and judge whether a workload is cache-friendly.
- Compute the hit ratio, the average read time and the load that still reaches the database.
- Estimate how much memory a cache needs for a given share of traffic.
- Name the costs of a cache: stale data, memory, a second system to run.
Every later page in this level (patterns, eviction, problems, layers) assumes that a cache is worth having. This page shows when it is, with numbers. A cache that is used on the wrong data adds cost and bugs and saves nothing. The tier is Core. The numbers are made up to show the idea, unless the text names a book.