Adding a new column is one of the most common schema changes, but it’s also one that can destroy performance and uptime if done wrong. Whether your database is PostgreSQL, MySQL, or a cloud-native service, the method matters. Full table locks, replication delays, and migration conflicts can turn a small change into a production incident.
Start by defining the exact purpose of the new column. Choose the correct data type to match future queries and indexes. Keep it minimal — every extra byte adds overhead to reads and writes. If the column will be queried often, plan the index strategy at the same time you add it to avoid later table rewrites.
For large datasets, use online schema change tools like gh-ost or pt-online-schema-change for MySQL, or ALTER TABLE ... ADD COLUMN with ADD COLUMN IF NOT EXISTS in PostgreSQL when possible. These reduce locking and keep replicas in sync. Avoid default values that force a full rewrite of existing rows; instead, add the column as nullable and backfill in batches.