The cache is a copy
middlingA cache takes the load off a database by keeping answers that have not changed — and goes on serving them after they have. For how long, and what stops it, is the design.
0 of 4 done
1Read the diagram
Shop pages call the product API, which reads the product — name, description, price — from the database on every page load. At lunchtime that is 2,000 reads a second, nearly all of them for the same few hundred popular products, and a product's price changes a few times a day. The database is at 90% CPU. Of those 2,000 reads a second, how many come back with something different from the same read a minute earlier?