Skip to content
About
Main content

A distributed cache is not a latency tier

What does a distributed cache really buy, if a hit is slower than a local disk read?

"Local SSD, then distributed cache" is not a latency ordering

A common diagram lists the hierarchy as CPU → buffer pool → local SSD → distributed cache, which reads like steadily increasing . It is not. A distributed RAM cache is dominated by the network round trip at 0.3–1 ms. Local NVMe is about 100 µs. The distributed tier is typically 3–10× slower than the local SSD tier it is drawn beneath. By the tier-insertion rule, it cannot be justified on latency against the tier above.

It exists for three other reasons. Naming them correctly matters, because each leads to a different design.

Reason 1: Capacity pooling

If k nodes partition one keyspace (each key lives on exactly one node) instead of each node caching independently, the total distinct capacity is k·C. Under α = 1, rises by . For k = 20 over a corpus of 10⁹ items: ln 20 / ln 10⁹ = 2.996 / 20.72 ≈ 0.145, so about +14 points of hit rate, independent of C.

But it costs a round trip on (k − 1)/k of the hits (a key is on the local node only 1/k of the time). So it pays only when the origin is much slower than the network.

Same design with a fast origin. t_origin = 2 ms.

  • Gain: 0.145 × (2 − 0.5) = 0.145 × 1.5 ≈ 0.22 ms.
  • Cost: still ≈ 0.43 ms.
  • Net: negative.

Hence keyspace-partitioned caching is everywhere in front of and genuinely doubtful in front of a local database. The interesting question is not the hash ring (Making it fit). It is the ratio of the origin's latency to the network's latency. That ratio decides whether a distributed cache should exist.

Reason 2: Derived content

The remote tier usually holds objects whose miss cost is a recomputation, not a fetch. If making the entry costs 400 ms of computation, a 0.5 ms remote hit is a bargain, and the local-versus-remote inversion does not matter.

Reason 3: Surviving the process

A cache outside the application process survives deploys and restarts. This is not a latency argument at all. It is a defence against the cold-start pathology: after a restart the cache is empty, every request misses, and the backing store is overloaded (exactly what happened to Ifeoma). It is the reason a remote tier can be load-bearing in a system where the local tier is faster.

In one sentence: a distributed cache is slower than local disk. It buys pooled capacity (+ln k / ln N), recompute avoidance and restart survival, .