A cache is a shortcut to data, so the application still needs a path to the source. In a cache-aside flow, the application checks the cache first. On a miss, it reads the database, places that result in the cache, and returns it.
The interesting questions live around that simple flow: how long may a value be stale? What happens when many requests miss together? If the cache is unavailable, can the database absorb the traffic?
A useful design exercise: draw the miss path before the hit path. Then describe expiry and invalidation separately. Expiry limits how long a cached value stays around; invalidation responds to a change in the underlying data.
Walk through a cache miss below ↓