The Daily
A note a day on APIs and the realities of shipping web applications. Stuff I've actually learned across 25 years of doing the work.
Covering Indexes vs. Composite Indexes in MariaDB: Not the Same Thing
I spent years conflating these two concepts. Once I understood the difference, I rewrote three schemas and shaved real milliseconds off production queries.
I spent an embarrassing number of years thinking "composite index" and "covering index" were two names for the same concept. They're not. Once I actually internalized the difference - and more importantly, once I started reading output with that distinction in mind - I rewrote parts of three different schemas and saw…
Read the daily →MariaDB Auto-Increment Locks Will Bite You at Scale
InnoDB's auto-increment locking modes are invisible at low volume and painful at high write throughput. Here's what I learned the hard way.
I spent a frustrating afternoon last year chasing insert latency spikes on a MariaDB instance that had no obvious slow queries, no missing indexes, and a perfectly reasonable schema. The culprit was , the default on some older MariaDB builds, combined with a bulk-insert pattern that nobody had thought twice about…
Read the daily →Claude's Token Counter: Why Your Estimate and Your Bill Disagree
Client-side token estimation for Claude drifts more than you'd expect. Here's why it happens and how to use Anthropic's actual counting endpoint to close the gap.
I assumed token counting was a solved problem. It isn't - at least not if you're trying to predict your Claude bill before a request hits the wire. I built a document processing pipeline for a biotech client last year. We were chunking lab reports, running them through Claude to extract structured data, and I had a…
Read the daily →R2 CORS Wildcards Don't Work Like S3 and It Will Break You
Cloudflare R2 CORS configuration looks identical to S3 on the surface. It is not, and the difference will silently kill your presigned upload flow.
I spent half a day last month debugging a presigned upload flow that worked perfectly against S3 for two years and broke the moment I pointed it at R2. The bucket was configured, credentials were valid, the presigned URLs generated fine. The browser just kept throwing CORS errors and I kept staring at a CORS config…
Read the daily →S3 Multipart Upload: The Hidden Cost Nobody Checks
Multipart upload is great until you forget to clean up failed parts. I've seen clients quietly accumulate hundreds in orphaned upload storage.
S3 multipart upload is one of those features that feels optional until it isn't, and then when things go sideways you discover a billing surprise that's been quietly compounding for months. I've hit this twice with real clients - once with a biotech lab uploading genomic datasets, once with a print management shop…
Read the daily →