Caching Strategies — Series 2

Preview — 3 of 10 questions

Compare read-through caching with the cache-aside pattern (where the application itself checks the cache, then falls back to the database on a miss).

ARead-through caching is identical to cache-aside — the terms are simply synonyms used by different vendors
BIn read-through caching, the cache library/layer itself is responsible for loading data from the database on a miss and populating itself — the application only ever talks to the cache, never directly to the database for reads. In cache-aside, the application explicitly manages both the cache lookup and the database fallback logic itself
CRead-through caching means the cache is read once at server startup and never updated again
DRead-through caching can only be implemented with a relational database as the backing store

Before a big product launch, an engineering team pre-loads the cache with expected hot data ahead of time, instead of letting it fill up naturally from real traffic. What is this technique called, and why do it?

AThis is called "cache warming" — proactively populating the cache with anticipated hot keys before traffic arrives, so the very first real requests hit a warm cache instead of all triggering cold cache misses (and hammering the database) simultaneously
BThis technique is called "cache cooling," and it's done to intentionally slow down response times before a launch
CPre-loading a cache before traffic arrives is impossible — caches can only be populated reactively, in response to real requests
DThis is a form of database sharding, unrelated to caching

A lookup service frequently receives requests for IDs that dont exist, and each of those misses triggers a full, expensive database query that finds nothing. Whats negative caching, and how does it help here?

ANegative caching means storing only failed HTTP requests for later retry, unrelated to lookup results
BNegative caching means the cache automatically deletes any entry marked as "negative" or "invalid" after every write
CNegative caching means also caching the absence of a result (e.g., "ID 12345 does not exist") for a short TTL — so repeated lookups for the same non-existent ID hit the cache and return "not found" quickly, instead of re-running the same expensive, always-empty database query every single time
DNegative caching is a synonym for cache eviction — removing old entries to make room for new ones

Sign up free to play

Answer all 10 questions (7 more), see explanations for every answer, and track your score.