Back to results for “Caching Patterns”
Redis › Caching Patterns

How does the read through caching pattern work, and how is it different from cache aside from the application's perspective?

Intermediate

Answer

In read through caching, the caching layer itself is responsible for fetching data from the database when it is missing from the cache, meaning the application always just asks the cache for data without needing its own logic to check the database, unlike cache aside where the application explicitly handles the fallback to the database itself.
-- With read through, the cache client or library
-- automatically fetches from the database on a cache miss
-- and the application code only ever talks to the cache
Real-world example A company uses a caching library that automatically loads missing data from the database behind the scenes, simplifying their application code since it only ever needs to call the cache directly.

Common follow-ups: What libraries or tools provide built-in read through caching support for Redis?;Is read through caching harder to implement than cache aside?