Adding a new column is one of the most common schema changes in production systems. It looks simple, but it intersects with uptime, data integrity, and performance. The wrong approach can trigger locks, slow migrations, or even full outages. The right approach is deliberate and fast.
First, decide if the new column is nullable or has a default value. Non-null columns require a migration plan to backfill existing rows. For massive datasets, running a single blocking UPDATE is a risk. Use batched updates or background jobs to avoid long locks.
Second, check index needs. Adding an index on the new column can speed lookups, but building it on a live system can spike I/O. Online index creation or adding the index in a later step can reduce load.
Third, deploy the schema change without breaking the application. Ship code that can handle both old and new schemas before running the migration. This avoids race conditions between deploy steps.