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.
GraphQL's N+1 Problem: The One It Hides and the One It Creates
GraphQL promises to fix over-fetching. What it doesn't tell you is that it ships its own N+1 problem in the box.
GraphQL will tell you it solves the N+1 problem. It doesn't. It trades the REST version for a worse one, wraps it in a type system, and ships it to production while you're still feeling good about your schema design. I've been burned by this on two separate projects now, and I want to save you the 2 a.m. Datadog…
Read the daily →PostGraphile: The Schema You'll Regret in 18 Months
PostGraphile generates a GraphQL API from your Postgres schema in minutes. That speed comes with a tax you don't notice until you're deep in production.
PostGraphile will have you running a full GraphQL API against your Postgres database in under an hour. That is genuinely impressive and also, in my experience, the start of a slow-motion problem you won't fully see until your client is asking why a mobile app query takes 4 seconds. I've now used PostGraphile on three…
Read the daily →GraphQL Caching Is a Different Sport — Most Teams Miss It
HTTP caching assumptions break the moment you go GraphQL. Here's what actually works and what I've learned shipping it in production.
Most teams switching to GraphQL don't realize they've just opted out of a decade of HTTP caching infrastructure — until they're staring at a database on fire and a CDN that's doing absolutely nothing. I've built GraphQL APIs for a few clients now — a biotech client doing lab data queries, a real estate platform…
Read the daily →JSONB Everywhere Is a Smell
JSONB is one of Postgres's best features. It's also one of the easiest to abuse. Here's where I draw the line.
JSONB saved me on a project once, then nearly wrecked a different one. The difference wasn't the feature — it was whether I was using it to solve a real modeling problem or just to avoid making a decision. I see this pattern constantly in codebases I inherit: a column of type on half the tables, a blob on the other…
Read the daily →Why I Went Back to REST After Two Years on GraphQL
I bought into GraphQL hard. After two years and several production apps, I switched back to REST. Here's the honest post-mortem.
I was a GraphQL believer. I gave the conference talk in my head, I migrated a production codebase to it, I evangelized it to clients. Two years later I ripped it out of two projects and went back to REST. This is not a hot take — it's a post-mortem. What GraphQL Promised Me The pitch is genuinely compelling. One…
Read the daily →