Adding a new column sounds simple. In production, it can trigger downtime, lock tables, or slow every query. The right approach depends on table size, database engine, and deployment constraints. Skip the planning, and you risk data loss or broken code in production.
First, decide if the new column is nullable. Adding a nullable column in most relational databases is fast because it updates only the schema metadata. Adding a column with a default value often rewrites the table, which can be slow for large datasets.
Next, align schema changes with application code. Avoid deploying code that expects the new column before it exists. In zero-downtime systems, create the column first, backfill data asynchronously, then switch reads and writes to use it. Roll out in phases.
For Postgres, ALTER TABLE ... ADD COLUMN works, but watch for default values that trigger table rewrites. For MySQL with InnoDB, online DDL can help, but test for subtle locking. SQL Server adds columns efficiently if they are nullable or have constants as defaults.