When schemas evolve, so must the database. Adding a new column sounds simple, but in production systems it is where mistakes turn costly. A careless migration can lock tables, stall queries, or corrupt live workloads.
First, choose the right migration method. For small datasets, a direct ALTER TABLE ADD COLUMN may be enough. For large datasets, avoid blocking operations by using online schema changes from tools like pt-online-schema-change or native database support for concurrent alterations.
Second, decide on defaults and nullability. A nullable new column offers fast deployment but increases risk of NULL-handling bugs downstream. Non-null with a sensible default reduces runtime checks, but may require a backfill step before enforcing constraints.
Third, plan for indexing after data has populated. Creating indexes during the column addition slows migration and increases lock times. Split operations: add column, backfill data, then create index.