CACHING
$40 becomes $35.
Someone waits.
TWO WAYS TO KEEP A FAST COPY
$40
APP
your site
$40
CACHE
a fast copy
$40
DB
the original
asks  ·  $40 brings it back  ·  unused
Right now both say $40.
CACHE-ASIDE THE DEFAULT
$35 $35 $35
APP
$40
—
CACHE
$40
$35
DB
1you save $35
2cache emptied
3off to the DB
4refill last
The reader pays.
WRITE-THROUGH BOTH AT ONCE
$35 $35 $35
APP
$40
$35
CACHE
$40
$35
DB
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.