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.
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 contentsThis 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