Adding a new column is simple on paper, but in production, it can be the knife edge between progress and downtime. Schema changes touch live data, indexes, queries, caches, and API contracts. The wrong move can lock tables, spike latency, or corrupt writes. The right move is invisible, seamless, and safe.
A new column usually starts with a schema migration. In relational databases like PostgreSQL or MySQL, ALTER TABLE ADD COLUMN is the command. But executing it blindly on a large table can block reads and writes for seconds or minutes, depending on size and engine. This is why online migrations matter. Tools like pg_online_schema_change, gh-ost, and pt-online-schema-change let you add columns with no downtime by copying data into a shadow table and swapping it in.
Default values deserve caution. Adding a new column with a non-null default forces the database to rewrite every row. On large datasets, this can crush performance. Instead, add the column as nullable, backfill in batches, then add constraints once the data is ready. The same principle applies to adding indexes for that new column: build them concurrently to avoid locking the table.