Index

Caching: the slate next to the stove

Chapters

Narration

Last time the walas were made to remember nothing, and that is exactly what made them interchangeable. But it left a bill. Every single question now walks to the register in the back room. How much is one chai, asked five hundred times, is five hundred walks. So you chalk a slate next to the stove. Chai, ten rupees. The tab, one hundred and twenty. Look at the slate first, and only walk to the back when the line you need is blank. Found on the slate, and the answer is instant. Blank, and you take the slow walk to the back room, then chalk the answer on the way out so the next person never has to. The whole game collapses into a single number. What fraction of questions never leave the counter at all. Push that high enough and the back room stops being a queue. But a slate has two curses. The first is staleness. The milk price changes in the register, and the slate still says ten rupees. Now every customer gets a wrong answer, confidently. The second curse is that the slate is small. When the chalk space runs out you erase the line nobody has asked about lately and keep the crowd pleasers. Hot things live on the slate. Rare things always take the walk. Which is why the oldest joke in the field finally lands. There are only two hard things in computer science: cache invalidation, and naming things.

Saved in this browser only.