Adding a new column should be simple. The schema changes. The data evolves. The system moves forward. But in production, under load, with real users hitting endpoints in milliseconds, that new column can break everything if you do it wrong.
Most teams start with an ALTER TABLE statement. In small datasets, it’s instant. In large tables, it locks writes, spikes CPU, and slows queries. The longer it runs, the bigger the risk window. That’s why experienced teams plan the new column work like a deployment.
First, decide if the column is nullable. Non-null columns need defaults. Defaults on big tables can backfill millions of rows and block for minutes or hours. To avoid downtime, add the column as nullable, then backfill in small batches. After backfill, add a NOT NULL constraint in a separate migration.
Second, pick the right data type from the start. Changing a column type later is far more disruptive than creating the right type up front. Align the type with the queries and indexes it will support.