databases go concurrency

A lock-free ring buffer that actually held up in production

We replaced a mutex-guarded queue with a single-producer/single-consumer ring and watched p99 latency drop by half. The catch was memory ordering — atomic.Load with the wrong fence gives you a buffer that is correct only on x86.

Read more
observability postgres

Slow-query archaeology: reading EXPLAIN like a detective

A 40ms query became 4 seconds overnight and nobody touched the code. The culprit was a planner regression after autovacuum reset the statistics. Here is how I read EXPLAIN (ANALYZE, BUFFERS) to find the lie in the row estimates.

Read more
distributed-systems testing

Catching a once-a-month bug with deterministic simulation

Flaky failures are just non-determinism you have not pinned down yet. By feeding a seeded clock and a controllable network into the same code path, a heisenbug that surfaced monthly became reproducible on every run with --seed 41.

Read more