ContentsThe library

Keeping the Answer Nearby

Choosing How Far Away to Keep It

Last timeKeeping It Honest

There is a ladder of places a copy can live, from the reader's own device to a shared tier beside the store, and each rung trades speed against how many people the copy serves.

A cached answer has to be somewhere, and the choice of where is more consequential

than the choice of eviction rule. It sets how fast the answer arrives, how many

people it can serve, how much of it you can hold, and how hard it is to keep

honest.

FIG 1Every place a request can stop
Reading down the ladder, each rung is slower to reach and serves more people than the one above it. Almost every real arrangement uses two or three rungs rather than one, and the interesting decisions are about which answers go on which.

The ladder

Notice that the ladder is also an order of capacity. A device holds a few

megabytes, a point of presence holds a great deal, a service process holds

whatever is spare in its own memory, and a shared tier holds as much as you are

willing to pay for.

Inside the process

The fastest cache available is a map in the same process as the code asking the

question. There is no serialisation, no socket, no round trip. A hit costs the

time to follow a pointer, which is to say nothing at all.

The lesson stops here

6 more paragraphs to go

You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.

The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.

See the planThe contents

This is the reading half

Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.

The contents

The rest of this course

  1. 01The Same Thing, Asked Again
  2. 02What You Actually Buy With a Hitopening only
  3. 03Choosing What to Forgetopening only
  4. 04When the Copy Stops Being Trueopening only
  5. 05Choosing How Far Away to Keep Ityou are here
  6. 06The Ways a Cache Turns On Youopening only
  7. 07Many Boxes Pretending to Be Oneopening only
  8. 08Telling Whether It Earns Its Placeopening only

Read alongside