Skip to Content

When is Cache-Aside better than Read-Through?

Category: System Design

Answer

Cache-Aside (lazy) lets the application decide when to populate. Read-Through makes the cache library responsible on miss. Cache-Aside is the dev’s friend — you can wire invalidation, custom TTL per key, fall-through to a wrapper service. Read-Through is cleaner when you want a generic get_or_load.

Concrete examples from the fca project context

Example 1

Cache-Aside: try cache; if miss, load from DB and SET; return value.

Example 2

Read-Through: cache.get(key) returns cached OR calls loader + SET inline.

Example 3

For per-tenant TTL or cache-key normalization, Cache-Aside wins on flexibility.

Data flow / flow chart

app -> cache.get(key)
  miss -> db -> cache.set(key, val) -> return

Takeaway

Cache-Aside when you need fine-grained control over TTL, key shape, and invalidation.