QamoosTech
Architecture & DesignScaling and performanceIntermediate

Cache-Aside

PronunciationKASH uh-SIDE

Definition

Cache-aside is a caching pattern where the application checks the cache first, and on a miss loads from the database and stores the result in the cache for next time.

Where you hear it

In Redis usage guides, system design interviews and performance fixes for slow read endpoints.

Examples

  • On a miss we read from the database, then set the cache with a 5-minute TTL.
  • After an update we delete the cache key so it reloads.
  • The product page reads the cache first and falls back to the database on a miss.

Common mistake

Forgetting to invalidate the key on write, so users see stale data until the TTL ends.

Don't confuse with

Write-through, where every write goes to the cache and the database together.

Say it at work

  • In a meeting or chatLet's use cache-aside for the leaderboard.
  • In an email or ticketWho invalidates the key on update?