Day 15: How Caches Work

Week 3: two paragraphs Β· about 20 minutes

Today: Warm up: review your flashcards (2 min) 1 Read2 Spell3 Say4 Words

1. Read 5 minutes

A cache is a small, fast store that keeps copies of data you use often. Think of a kitchen. The fridge is the cache and the supermarket is the database. You keep milk in the fridge because walking to the shop every time would be slow.

But caches have a cost. The copy in the fridge can get old. If the shop changes the price of milk, your fridge does not know. Engineers call this stale data. So every cache needs a rule for when to throw old copies away. This rule is called eviction, and choosing it well is one of the hard parts of system design.

How. Read one sentence. Look up. Say it in your own words. Then go on. Keys: β†’ next, ← back, Esc to show all.

Check yourself

In the example, what is the cache?

The fridge.

What is stale data?

An old copy that no longer matches the source.

2. Spell 5 minutes

✏️ Commonly misspelled work words (1)

Find the trap in each word and remember it.

Watch out. sep-A-rate (a rat in the middle), defin-I-tely, enviro-N-ment, argu-ment (no e).

Test yourself. The words hide. You hear a word, then type it.

3. Say 5 minutes

πŸ‘„ sh and ch

sh is a long, soft hush: shhh. ch starts with a stop, like t + sh: ch.

Words

Hear the difference

How. Press πŸ”Š, then say it 3 times. Record yourself on your phone and compare.

4. New words 5 minutes

Say each word out loud. Then make your own sentence with it.

store

say: STOR

a place that keeps things

β€œThe cache is a fast store.”

copy

say: KOP-ee

something made to be the same as another

β€œKeep a copy of the file.”

stale

say: STAYL

old, not fresh

β€œThe page shows stale data.”

cost

say: KOST

what you lose or pay to get something

β€œSpeed has a cost.”

eviction

say: ih-VIK-shun

throwing something out of its place

β€œThe cache uses LRU eviction.”

Review today's flashcards