Adding a new column sounds simple. It rarely is. In production, schema changes can trigger locking, spike CPU use, and stall writes. The wrong approach turns a clean migration into hours of downtime. The right approach finishes before anyone notices.
Plan the schema change. Know if it’s nullable or needs a default. Decide whether to backfill existing rows upfront or lazily. In relational databases like PostgreSQL and MySQL, adding a nullable new column without a default is almost instant. Adding a non-null column with a default can rewrite the entire table, depending on engine and version.
For large datasets, break the work into steps. Create the column empty. Deploy code that can read and write it. Backfill in small batches to avoid saturating I/O. Finally, enforce constraints when the data is ready.