A backing store is the authoritative storage layer from which a cache obtains values that are absent or expired. It may be a database or service containing the primary copy of the data, while the cache keeps temporary copies closer to callers to reduce access latency. section 6.3 section 6.0
The backing store determines how caching behaves when data is unavailable or changes:
- On a cache miss, the application or cache retrieves the value from the backing store, depending on the caching strategy. section 6.2 section 6.3
- Read-through caching makes the cache query the backing store, transform the result into a cacheable format, update itself, and return the value. section 6.3.2
- Write-through caching synchronously propagates cache updates to the backing store, trading write latency for closer synchronization and possible transactional guarantees. section 6.3.3
- Expiration, replacement, or a low cache hit ratio increases backing-store traffic; a high ratio reduces slow lookups, while excessive caching can still add overhead. section 6.11 section 6.2
Read-through database lookup
An application requests a key from a read-through cache. On a miss, the cache queries the database, converts the result into JSON, stores it, and returns it. The application does not need to manage the database lookup, but the cache becomes coupled to the data model and backing-store format. section 6.3.2
Figure 6.2 With read-through caching, the client looks up a key from the cache. Unlike with cache-aside caching, the read-through cache queries the database and updates itself on a cache miss.
Trace the cache-to-database path during a read-through miss: client lookup, backing-store query, cache update, and response. section 6.3.2
