Skip to content
About
Main content

Nine prohibitions and their escapes

What caching forbids

Each item is something no design can do. Each comes from a derivation in an earlier article.

  1. Freshness over a bypassable copy without paying coordination, verification, or staleness. There is no fourth currency.
  2. Buying hit rate in a linear way. C ≈ N^h at α = 1. And at α ≤ 1, a fixed cache against a growing corpus decays, silently.
  3. Optimal online eviction. A deterministic policy is k-competitive at best, a randomized one Θ(log k), and no policy escapes that.
  4. Exact decisions about reusing cached query fragments. This is NP-complete at best and undecidable in general.
  5. Exact invalidation, unless you keep the derivation graph at write granularity. Maintaining that graph costs about as much as the cache saved.
  6. Consistency across entries without a single designated version cell.
  7. Improving any percentile above h.
  8. Splitting one hot key across nodes by hashing.
  9. Caching a workload with no reuse. Nothing in the subject can replace reuse. This is the only prohibition with no escape at all.

The escapes and what each costs

EscapeBuysCostsWho pays
Immutability + content addressingdeletes invalidation and the write-routing dimensionprepaid write amplification + garbage collectionthe writer and the janitor
Declaration ()incrementality: the write path can be hookedcoupling; k views means k obligations on the write paththe writer
Algebra (, )delta maintenance and reuse by rollupexactnessthe reader's precision
Verification (, ETags)near-coherencea round trip per read instead of a payloadthe reader, cheaply
Randomizationremoves coordination entirelyslightly more work, weaker worst-case guaranteesdiffuse
Admission sketches with bounded damageapproximate frequency, one window of pollutionthe one-shot traffic
Partitioning / pinningisolation guaranteesutilizationidle capacity
Tieringlower miss time instead of higher on the miss path; a new coherence boundarythe misses
kills the otherwise unfixable hotspota tier you cannot invalidatestaleness

(A monoid is an operation with a neutral element that can be combined in any grouping, such as sum or max. Aggregates with this property can be maintained from the change alone and rolled up. A materialized view is a stored query result that the database keeps up to date.)

Read the first row against the last. The only difference is whether you were able to make the data first.