The table is ready, but the numbers don’t match the plan. You add a new column. Everything changes.
A new column sounds simple until it isn’t. In a database, it can break queries, shift indexes, and trigger unexpected cascades. In production, it can lock writes, increase storage costs, and slow down critical paths. Schema changes are not just code changes—they are changes to the system’s shape.
When adding a new column, the first choice is type. Choose it wrong and you invite future migrations, data loss, or casting errors. Strings seem safe, but they grow without limit and turn sorting into pain. Integers are smaller, faster, but brittle to overflow. Booleans are compact but may oversimplify future logic.
The next decision is default values. Backfilling a new column with defaults can hammer a database if done in one transaction. Spread updates in batches. Monitor performance metrics. Track replication lag.
Nullability is another trap. NULLs offer flexibility but complicate joins and aggregates. Making a column NOT NULL without defaults can lock a table longer than your deploy window allows.