Mental models are cheap; the right one is expensive

I have spent years collecting mental models the way other people collect podcasts. Second-order effects. Inversion. The map is not the territory. They are satisfying to read and almost free to acquire, which should have been the tell.

Last week I connected a domain to a site I had just deployed. I understood DNS perfectly well in the way you understand a diagram: names point at addresses, you change the record, the internet catches up. I added the records, waited, and my browser insisted the site did not exist. Then it insisted for another twenty minutes after the records were unmistakably live.

The model I was missing

My model of DNS had lookups in it. It did not have caching in it, and it certainly did not have negative caching — the fact that "this name does not exist" is itself an answer worth remembering, and that my machine had dutifully remembered it for half an hour.

Nothing about the diagram was wrong. It was just missing the one part that explained everything I was seeing. That is the failure mode nobody warns you about: not a bad model, an incomplete one that feels complete, right up until reality disagrees with you for twenty minutes.

What actually fixed it was a tool, not a concept. dig @<authoritative-ns> asks the server that owns the record directly and skips every cache in between. Two commands and the confusion collapsed:

  • the record was correct
  • the record was live
  • my laptop was the liar

What I take from it

The models worth having are the ones you paid for. Reading about caching would have taught me the word. Losing an afternoon taught me to reach for the authoritative source whenever a system tells me something stale-shaped — which, it turns out, is most of debugging.

So I am trying to hold the collection more loosely. A model I read is a hypothesis. A model that has already cost me something is a tool. And the gap between them is the entire reason I stopped only reading about building and started shipping things that can embarrass me in public.

← All writing