liveBook · Manning

Backing store

As explained in Latency

A backing store is the authoritative storage layer from which a cache obtains values that it does not contain or whose cached copies have expired.

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.
Figure 6.2: With read-through caching, client looks up a key from the cache. Unlike with cache-aside caching, the caches queries the database and updates the cache on 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

How Latency covers it

How deep it goes
Explains cache misses, read-through and write-through flows, serialization, latency, consistency, TTL, and hit-ratio effects.
Examples
Uses databases, services, SQL results converted to JSON, and customer searches with negative results as concrete cases.
What it assumes
Assumes familiarity with caches and cache keys while defining hits, misses, temporary copies, and primary data storage.
What you can do after
Evaluate caching strategies by tracing miss paths, measuring hit ratios, and weighing backing-store latency against consistency and complexity.
How it connects
Connects backing stores to caching strategies, cache misses, cache hits, TTL, cache consistency, and cache replacement policies.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Latency. The section links point to the parts of the book it draws on.