CACHING
$40 becomes $35.
Someone waits.
TWO WAYS TO KEEP A FAST COPY
asks
·
brings it back
·
unused
Right now both say $40.
CACHE-ASIDE
THE DEFAULT
1you save $35
2cache emptied
3off to the DB
4refill last
The reader pays.
WRITE-THROUGH
BOTH AT ONCE
1you save $35
2the DB too
3both done
4one hop
Saves wait. Reads fly.
Here's who waits.
CACHE-ASIDE — readers wait.
Saves stay fast.
WRITE-THROUGH — writers wait.
Reads stay fast.
$40 becomes $35.
Someone waits.
You'll want this one
in the design round.