# Cache-aside vs Read-through

> Cache-aside puts cache lookup, database fallback, and cache population in application code; read-through delegates miss loading to a cache abstraction with a configured loader. Choose cache-aside for explicit, request-specific control, or read-through to centralize reusable loading behavior. Neither automatically solves stale data, cache stampedes, or database overload.

Source: https://sysround.com/compare/cache-aside-vs-read-through
Updated: 2026-11-05


## Side by side

| | Cache-aside | Read-through |
|---|---|---|
| Read path | Application checks cache, then database on a miss | Application reads through a cache abstraction |
| Miss loading | Application fetches and populates | Configured loader fetches and populates |
| Loading policy | Explicit in each application read path | Centralized behind the cache interface |
| Request-specific behavior | Easy to customize or bypass | Must fit the loader interface and key model |
| Implementation | Works with a basic key-value cache | Needs a loading library, service, or cache feature |
| Concurrent misses | Application must coordinate loads | Loader may coalesce loads; verify scope |
| Cache failure | Application chooses fallback behavior | Abstraction must define failure and bypass behavior |
| Write consistency | Requires an explicit update or invalidation policy | Also requires an explicit update or invalidation policy |

## The differences that matter

The main difference is ownership, not whether data loads lazily. In cache-aside, application code performs GET, database lookup on a miss, and SET. In read-through, the application calls a cache interface whose loader performs the database lookup and population. That interface can be an in-process library or a separate service; read-through does not require the cache server itself to query the database.

Cache-aside makes exceptions straightforward: bypass the cache for an authoritative read, batch several database lookups, or avoid caching a particular result. Read-through makes shared loading rules easier to enforce, but its interface must support the required batching, deadlines, and key semantics. User-dependent results still need safe tenant and authorization boundaries in either design.

Centralized loading can simplify stampede protection, but it does not guarantee it. A read-through library might merge concurrent misses only within one application process, leaving many processes to load the same hot key. With either pattern, specify the coordination scope, loader concurrency limit, TTL jitter, and whether stale data may be served during refresh.

Failure handling must distinguish a missing key from an unavailable cache or failed database load. Cache-aside exposes those decisions directly to the application; read-through packages them behind its API. In both cases, unrestricted database fallback during a cache outage can overload the database, so define deadlines, circuit breaking, and load shedding.

Neither read pattern specifies the write path. Both can serve stale data, and both can suffer a race where a reader loads an old database value and fills the cache after a writer has invalidated it. Choose invalidation, version checks, or stronger coordination based on the freshness requirement rather than assuming read-through provides consistency.

## Choose Cache-aside when

- Different endpoints need different bypass, fallback, or cache-admission rules.
- Your cache is a basic key-value service, and the application already owns database access.
- Misses require request-specific queries or batching that a shared loader interface would make awkward.
- You want a small, explicit caching layer without introducing a shared loading service or framework.

## Choose Read-through when

- Many callers retrieve the same entities and should share one loading and serialization policy.
- You already have a loading-cache library or service with suitable timeout, error, and concurrency controls.
- You want to keep repeated miss-handling code out of application handlers.
- Entity lookup is stable and key-based, and you can define clear ownership for loader changes and source access.

## Worked example: URL redirects with a shared miss loader

Suppose a URL shortener handles 40,000 redirects per second with an assumed 98% cache hit rate. The database receives about 800 reads per second from misses, excluding retries and other traffic. With cache-aside, each redirect handler checks the cache, queries the mapping store on a miss, and populates the result. With read-through, the handler requests the short code through an abstraction whose loader performs those steps. The steady-state database load is similar under identical policies. If a popular code expires, process-local load coalescing still permits one database request per process. Choose based on policy ownership, then separately bound concurrent loads and plan for cache outages.

## In the interview

- Draw the miss path and name the component that queries the database. Saying only 'use Redis' does not establish whether the design is cache-aside or read-through.
- State the freshness requirement separately from the read pattern. Expect follow-up questions about updates, invalidation races, and read-after-write behavior.
- Estimate database read load as request rate multiplied by miss rate, then discuss cold starts and outages separately. A healthy steady-state hit rate does not describe those cases.
- Explain whether concurrent misses are coalesced per process, per cache node, or across the fleet. The interviewer may probe a hot key expiring on many instances at once.
- Specify cache and loader deadlines, fallback limits, and observability. Track hit rate, load latency, load errors, and database traffic so hidden loader work remains visible.

## Common mistakes

- Calling an application sequence of cache GET, database query, and cache SET read-through merely because it uses a remote cache.
- Assuming read-through means write-through, automatic invalidation, or strong consistency.
- Assuming a loading-cache API guarantees fleet-wide request coalescing or lower latency.
- Treating every cache error as a miss and sending unlimited fallback traffic to the database.

## Interview questions where it comes up

- [Design a URL shortener like Bitly](https://sysround.com/questions/design-url-shortener): The redirect path needs an explicit miss loader, hot-key protection, and a bounded database fallback policy.
- [Design a distributed cache](https://sysround.com/questions/design-distributed-cache): The cache API must define whether source loading is part of its contract and how concurrent loads and failures behave.
- [Design a weather app](https://sysround.com/questions/design-weather-app): Reusable location-based reads make loader ownership, upstream request limits, and stale-data behavior central design decisions.
- [Design Wikipedia or Notion](https://sysround.com/questions/design-wikipedia): Cached document reads require a loading strategy plus an independent plan for version changes and invalidation races.

## FAQ

### What is the difference between cache-aside and read-through caching?

With cache-aside, application code handles cache misses by reading the source and populating the cache. With read-through, a cache abstraction handles misses through a configured loader. Both usually load data on demand, but responsibility sits in different components.

### Is read-through caching faster than cache-aside?

Neither is inherently faster. With the same cache, topology, and loading policy, their read paths can perform similar work. Network hops, batching, serialization, and miss coalescing matter more than the pattern name.

### Can Redis provide read-through caching?

A basic Redis GET does not query your database and populate a missing value. You can build a read-through abstraction using a library or service that wraps Redis and invokes a loader. If the application explicitly performs the lookup, database query, and population, that is cache-aside.

## Related concepts

- [Caching strategies](https://sysround.com/concepts/caching-strategies)
- [Cache invalidation](https://sysround.com/concepts/cache-invalidation)
- [Cache stampede and thundering herd](https://sysround.com/concepts/cache-stampede)
- [Hot keys and hot partitions](https://sysround.com/concepts/hot-keys)
- [Circuit breakers](https://sysround.com/concepts/circuit-breaker)


---
SysRound (https://sysround.com) is an AI practice tool for system design interviews: a voice or typed AI interviewer, a shared whiteboard, then feedback on every skill and a model answer. Its feedback is AI-generated and can be wrong.
