Menu

Code evolves quickly, databases remember everything
πŸ“°

Code evolves quickly, databases remember everything

DEV Community: backendΒ·Odinaka Robert NnamaniΒ·1 day ago
#0tXqdi7L
#devtobackend#devto#dev#code#database
Reading 0:00
15s threshold

A common backend mistake: treating database schemas like temporary code.

Code deploys in minutes. You ship it, watch it, roll it back if it's wrong. A schema doesn't work like that. The moment production data exists, the schema becomes the memory of the system β€” and memory doesn't roll back.

Every shortcut compounds:

The column you added as nullable "for now" still has three meanings two years later

The status value you retired still sits in a million old rows

The constraint you skipped in the app gets skipped by the second service too

So schema design has to consider what code design can postpone: relationships, constraints, future queries, data integrity. Put the constraint in the database, not just the validation layer β€” applications change, get rewritten, multiply.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.