Adding a new column sounds simple. In production, it can break live systems if done carelessly. Schema changes are more than a single SQL statement—they touch application code, APIs, queries, and indexes. A new column introduces complexity in locking, replication, and backward compatibility.
Start by defining the exact data type and constraints. Choose defaults carefully to avoid large table rewrites. For massive datasets, use NULL as the initial default to prevent locking writes for hours. Then backfill the column in controlled batches.
Coordinate schema updates with application deployments. Deploy code that writes to the new column only after the schema exists in all environments. For reads, feature-flag access until the new column is fully populated. This reduces the risk of null-pointer issues and inconsistent behavior.
Indexes on the new column should be created after backfill to avoid locking reads and writes. In high-throughput systems, create them concurrently if the database supports it. Avoid multi-column indexes unless the query plan proves they are necessary.