Adding a new column to a table sounds simple. In reality, it can trigger lockups, break queries, or cascade into deployment delays. The right approach depends on scale, schema design, and how your application reads and writes data.
The first step is to define the new column in a migration. Use explicit types and nullability. Avoid implicit defaults that hide missing data. In high-traffic systems, consider zero-downtime migration patterns such as adding the column with a default NULL, backfilling in small batches, then enforcing constraints later. This reduces lock time and contention.
If the new column requires backfilled data, run the operation in controlled chunks. Use indexed lookups to prevent full table scans. Monitor performance metrics during each phase. Validate results before advancing. Do not deploy application changes that assume the column exists until the migration is fully complete.