The schema was ready, the queries were fast, but the product team needed more data.
Adding a new column sounds simple. It rarely is. A single schema change can cascade through code, queries, indexes, migrations, and deployments. In production, a poorly planned ALTER TABLE can lock writes, block reads, or spike CPU usage. The database does not care about your sprint schedule.
When designing a new column, start with the type. Choose the smallest and most precise type that fits the data. Avoid TEXT or BLOB by default; prefer constrained VARCHAR, INT, or BOOLEAN. Set NOT NULL when possible. Add sensible defaults, especially for live tables, to avoid null hazards later.
Migrations are where risks multiply. On large datasets, adding a column can trigger a full table rewrite. Use non-blocking methods when available — for example, PostgreSQL’s ADD COLUMN with default NULL is fast, but adding a default value is not. Consider staged migrations: first add the column as nullable, backfill data in controlled batches, then apply constraints.