Writing / Lesson

How I design a database schema before writing any code

25 Aug 2026 · 9 min read

Most of the worst bugs I have shipped were not logic errors. They were modelling errors that logic had to work around.

I start with nouns. What things exist, what does each one own, and what is true about it at every point in time.

Then I write the awkward queries first. If a query the product obviously needs is hard to express, the model is wrong, and it is much cheaper to find out now.

Only then do I write a line of application code.

Placeholder essay. The real ones will be longer, with the specifics that make them worth reading.

Get the Sunday letter

One email a week: what I built, what broke, and one idea worth thinking about. No spam, unsubscribe whenever.

Not connected yet — the letter opens shortly.