The query runs. The data flows. But something is missing—your schema needs a new column.
Adding a new column sounds simple. In production, it rarely is. The risks are latency spikes, table locks, or silent schema drift across environments. The path to do it right starts with understanding how your database handles schema changes, what happens under load, and how to control the rollout.
For relational databases like PostgreSQL, ALTER TABLE ADD COLUMN is often instant for metadata-only changes. But default values can rewrite the table, triggering massive I/O. On MySQL with older engines or large datasets, the same statement may block reads and writes for minutes or hours. On distributed systems, new columns must replicate safely before applications reference them.
Plan the migration. Use additive changes first—new column, nullable, no default. Backfill in batches with controlled query size to avoid locking. Then add constraints or non-null defaults once the data is ready. Deploy application code that can handle the column existing or not, for smooth zero-downtime changes.