liveBook · Manning

Cache entry

As explained in Advanced Algorithms and Data Structures

A cache entry is one stored key-associated item or computed result contained in a cache.

A cache entry is one stored, key-associated item or computed result held for reuse. Entries consume finite storage, so a cache cannot grow indefinitely. section 7.3

Managing entries requires balancing capacity, lookup cost, and usefulness:

  • Adding entries eventually saturates the cache, requiring existing entries to be purged. section 7.3
  • The ideal eviction target is an entry unlikely to be requested again, although future demand cannot be predicted exactly. section 7.3
  • Recent access provides a practical heuristic: an entry unused for a long time may be stale and less valuable. section 7.3

A cache for a billion walls

Storing only the top 50 post IDs for each of a billion walls could require about a terabyte. As entries accumulate, RAM becomes insufficient and checking a larger cache can become slower. section 7.3

How Advanced Algorithms and Data Structures covers it

How deep it goes
Defines entries and motivates recency-based purging, but stops short of implementing the cache.
Examples
Uses top-post IDs for a billion walls to illustrate cache size and saturation.
What you can do after
Evaluate cache saturation and reason about recency as a practical eviction heuristic.
How it connects
Connects cache entries to cache capacity, RAM, distributed caches, and eviction policies.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Advanced Algorithms and Data Structures. The section links point to the parts of the book it draws on.