Edge-first: an architecture diary
Six months running a 240-POP edge deployment. What worked, what broke, and what I'd never do again.
Six months ago we shipped a platform on Cloudflare Workers — 240+ POPs, sub-30ms cold starts, fully serverless. This is a diary of what I'd do again, what I'd change, and what I'd never touch.
What worked: latency. We replaced an AWS Lambda + API Gateway stack that averaged 280ms p95 with a Workers stack that averaged 28ms p95. That's a 10x improvement, and it's not even close. Users in Singapore used to wait 600ms for a response; now they wait 40ms. That alone justified the migration.
What worked: deploy speed. We went from a 12-minute CI/CD pipeline to a 90-second one. The feedback loop change is hard to overstate — engineers ship 3x more often because shipping is cheap.
What broke: state. Workers are stateless, which is fine until you need a database. We tried D1 (Cloudflare's SQLite) and it works, but it's not Postgres. The moment you need joins, transactions, or any non-trivial query, you start missing Postgres. We ended up with a hybrid: Workers for hot paths, Postgres on RDS for the rest. The latency tax of going back to a region is real but manageable.
What I'd never do again: build a multi-region database myself. We tried CockroachDB for a month. It worked. It also cost 4x what RDS cost and added operational complexity we didn't need. For most apps, a single-region Postgres with a read replica is enough. Don't build a distributed database unless you absolutely have to.
Net: edge-first is the right default for new apps. But it's not a religion. Pick the parts that fit your latency budget, and don't be afraid to keep a region-based database for everything else.
Boring tech scales better than yours
Why I keep choosing Postgres and queues over the latest shiny thing — and how it's saved every team I've been on.
Eval-driven AI development
Stop vibe-checking your LLM. A practical workflow for shipping AI features you can actually defend in production.
Quiet hours: defending deep work
The single calendar change that doubled my output. A field note for engineers who keep getting interrupted.