The need for a new column is immediate, and the change must ship without breaking production.
Adding a new column is not simple schema decoration. It changes the shape of your data, impacts queries, and shifts application logic. Poor execution can lock tables, slow performance, or trigger downtime. Every second counts when the system is under load.
First, define the column exactly. Name, type, nullability, default value. Treat these as a contract with the future. In relational databases like PostgreSQL or MySQL, use types that balance precision and storage cost. Avoid unbounded text unless necessary. For numbers, choose the smallest type that fits your data range.
Second, plan the migration path. In large tables, an ALTER TABLE ADD COLUMN can block writes. For zero-downtime changes, run migrations in multiple steps: add the column with a safe default, backfill data in batches, and update the application code to use it. Monitor resource usage during backfill to avoid spikes.