Adding a new column sounds simple. It rarely is. In production, it touches code, tests, migrations, performance, and uptime. A careless change can lock tables, slow queries, and trigger rollback storms. The right approach makes it a safe, fast, zero-downtime operation.
First, design for compatibility. Add the new column without removing or renaming existing fields. Choose defaults carefully. Avoid making the column NOT NULL unless you can populate it for all rows immediately. Use NULL or computed defaults to prevent write failures during the transition.
Second, plan the migration. For large datasets, avoid a single blocking ALTER TABLE. Use phased migrations. Create the column, backfill in small batches, and deploy the code that writes and reads it in separate steps. This prevents outages and keeps the system responsive.