Recent Post

Your Index Has Three Jobs. A Sort Can Break One of Them.

I showed a colleague a query reading 109 documents to return one, and the index it was supposed to be using. He looked at both and said the obvious thing: “that’s not even the same index. It’s got four fields, your query filters on three completely different ones.”

Read more

Two Billion Documents a Week to Produce a List of Numbers

One query. Seven days. Here’s what it cost.

Read more

JaVers From First Principles: How Automatic Audit Logging Actually Works

Somebody asks who changed this invoice’s status last Tuesday, and from what. Your application has to be able to answer, and nobody wants to hand-write that logging on every setter.

Read more

Caffeine From First Principles: The Guarantee getIfPresent Doesn’t Make

Here’s a cache read. Three lines, no locks, nothing clever. It has a concurrency bug, and so does the identical code inside a library you may already depend on.

Read more

Your Feature Flag Bill Is a Cache Key Problem

A client exceeded their feature flag vendor’s monthly request quota by 100%.

The two fixes everyone proposed were delete the dead flags and stop calling flags inside loops. Both are sensible. Both save exactly zero requests.

Read more

The N+1 With No Query In It: JPA Fetch Types From First Principles

An export endpoint died at thirty seconds. Not degraded, died: the platform router gave up, the browser reported a CORS failure that had nothing whatsoever to do with CORS, and the UI showed a toast saying something went wrong.

I had three hypotheses inside twenty minutes of reading code. All three were wrong.

Read more