Adding a new column is common, but the details decide if it’s fast, safe, and scalable. On small tables, it’s simple. On large ones, a schema change can block writes, spike CPU, or lock rows for minutes. The wrong approach will take production down.
The process starts with defining what the column must do—type, nullability, default values, and indexing. Avoid defaults that force the database to rewrite every row. In PostgreSQL, adding a nullable column with no default is instant; adding one with a default rewrites data unless you use a later version’s optimized path. In MySQL, some ALTER TABLE commands require full table copies, which doubles storage usage temporarily.
Plan your migration. For critical systems, add the column first with no defaults or constraints. Backfill data in small batches. Then apply defaults and constraints in separate, safe steps. This reduces locks and keeps queries live.