Adding a new column to a database table looks simple. One line. One alteration. But in production systems with millions of rows, that change can block writes, lock tables, and trigger hours of downtime if handled carelessly.
The process starts with schema design. Define the column name, data type, nullability, and default values. Each choice has cost. Defaults can rewrite the whole table. Not null can reject inserts until every record has a value.
On high-traffic systems, avoid locking migrations. Use techniques like adding the column as nullable, then backfilling data in batches. After that, add constraints in a separate step. This reduces lock time and keeps the database online.
Indexes are another hazard. Creating an index for the new column can stall queries if done inline. Create indexes concurrently where supported or during low-traffic windows.