The API design mistake that haunts every version
I leaked my database shape through my API, and now every internal change is a public breaking change. Don't do this.
By Nzubechukwu Cyprian · Pharmacy student at UNN, full-stack developer
My first public API was a mirror of my database tables. It felt efficient at the time — the objects came straight from the ORM, fields and all. It took about three months to understand the trap: now the database couldn't change without breaking the API, and the API couldn't change without breaking clients. The internal detail had become a public contract.
What I do instead now
Design responses around what the client needs, not what the table stores. A "post" response includes the author's display name — not a user ID the client must resolve with a second call.
Version from day one. /v1/ in the path feels premature until the first breaking change, when it's the only thing standing between you and angry users.
Deprecate with a paper trail. New fields get added; old fields get marked, documented, and given a sunset date. Silent removal is how you teach people not to trust you.
Never expose what you can't take back. If a field might change meaning — don't ship it. Internal IDs, internal flags, internal status enums: all of them harden into permanence the moment someone builds on them.
The principle
An API is a promise, and promises should be about the domain — users, orders, posts — never about your storage choices. The database is an implementation detail. The moment clients can see it, they own it.
Keep reading
- Software engineering
Naming things is the whole job, sometimes
Most codebases don't have a naming problem — they have a thinking problem that shows up in their identifiers.
- Software engineering
Your README is your first interview
Before anyone judges your code, they judge your README. What a good one actually contains, from someone who reads a lot of them.
- Software engineering
The bug that taught me to read error messages properly
A three-line error sat in my logs for a week. It told me exactly what was wrong. I just never read past the first line.