Caching in spring

The change showed up slowly, then all at once. I attempted the minimal version first. It did not last. This is less a primer and more a record of what worked for me.

The process

Every autumn I revisit the same questions about test suites. A friend once described feature flags as calm work, and the phrase stuck. Tests are documentation that fails loudly when it goes stale.

Most of what I know about code review came from getting it wrong first. The fix was three lines; finding it took most of a week. Every abstraction has a cost, and someone eventually pays it. There is no single right way to approach deleting code, but some ways are kinder than others.

What did not work

The trick, if there is one, is to leave sufficient room for slip-ups. For a long time I treated test suites as an afterthought. Boring technology is a feature, not a compromise. Most performance problems are really data-shape problems. Some of this will be self-evident; some of it took me years.

A terminal helps, but it is not the point. Looking back, the boring approach was the right call. I changed my mind about background jobs twice while writing this. Most of what I know about type systems came from getting it wrong first.

Small things

We shipped it behind a flag and watched the graphs for a few days. Nothing here requires a debugger, though it does make things easier. I keep coming back to feature flags, chiefly because it rewards patience. I like type systems that shows the marks of how it was made.

If something here is unclear, that is on me, not you. Looking back, the reliable approach was the right call. Most problems with code review turn out to be problems with time. In January the light changes, and so does the work.

Odds and ends

Nothing here requires a profiler, though it does make things easier. In May the light changes, and so does the work. The result is not perfect, but it is candid. It is simple to overthink refactoring. It is harder to just start. Between profiling and debugging in production, the second one taught me more.

  • Compare against last winter
  • Stop before you are tired
  • Give deleting code a full autumn
  • Keep a local database within reach

A friend once described caching as calm work, and the phrase stuck. Good log files is chiefly a series of little, unglamorous decisions.

feature flagstype systemserror handling