← Lessons

quiz vs the machine

Gold1450

System Design

Multi Tier Caching

Layering local and shared caches so each request hits the fastest level first.

5 min read · core · beat Gold to climb

What it is

Multi tier caching stacks several cache layers of increasing size and latency. A request checks the fastest, smallest layer first and falls through to slower, larger layers, finally reaching the database only if every cache misses.

A typical hierarchy

  • L1 is an in process cache inside the application, the fastest but smallest and per node.
  • L2 is a shared distributed cache like Redis, larger and consistent across nodes.
  • The database is the source of truth, the slowest layer.

Benefits and costs

  • Most reads are served from L1 at memory speed with no network hop.
  • The shared L2 absorbs misses so the database stays protected.
  • The hard part is consistency: an update must invalidate the key in every tier, and a per node L1 makes that harder because each node holds its own copy.
  • Short L1 TTLs limit how stale a local copy can become between invalidations.

Key idea

Multi tier caching layers a fast local cache over a shared one over the database, maximizing hits while making consistency across tiers the central challenge.

Check yourself

Answer to earn rating on the learn ladder.

1. In a typical L1 and L2 setup, what is L1?

2. What is the hardest part of multi tier caching?