Skip to content
All insights

Architecture

Database Decisions That Become Expensive Later

Application code is easy to change. Data that already exists is not.

2 min read

Most painful migrations trace back to a handful of early choices about identity, relationships, time and deletion.

The database outlives the code around it. Every decision about how information is stored gets harder to reverse as rows accumulate, which is why data modelling deserves more attention than it usually receives in early products.

Choices that are costly to reverse

  • Identity: reusing a mutable value such as an email as a primary key.
  • Relationships modelled as arrays or JSON blobs instead of real references.
  • Time stored without timezone, or only as a display string.
  • Money stored as floating point instead of integers or decimals.
  • Hard deletes with no audit trail, when the business later needs history.
  • Multi-tenant data with no tenant column enforced from day one.

Cheap habits that prevent expensive migrations

  1. 1Use surrogate keys and treat business identifiers as attributes.
  2. 2Add foreign keys, unique constraints and not-null rules early — they are documentation the database enforces.
  3. 3Version every schema change and keep migrations reversible.
  4. 4Store timestamps in UTC and format at the edge.
  5. 5Decide the deletion policy before the first delete ships.

Building something similar? Talk to VNEXUS.

Share what you're building and where it hurts. A senior engineer will read it and come back with an initial technical view.

Related reading