Problem Statement
In the cache-aside pattern, which statement is true?
Explanation
Cache-aside keeps cache as a best-effort layer. Reads check cache, then DB on miss, and set the cache. Writes go to DB first, then invalidate or set the cache as needed.
Code Solution
SolutionRead Only
v = cache.get(k) || db.get(k); cache.set(k,v,ttl);
