Adding a new column sounds simple. It isn’t. Poor planning can block writes, lock tables, and slow production. The right approach keeps systems online while the schema evolves.
First, define the new column with minimal disruption. Use non-blocking schema changes where possible. In PostgreSQL, ALTER TABLE ... ADD COLUMN with a default value can rewrite the table — avoid this in large datasets. Add the column as nullable, then backfill in batches. When data is complete, enforce constraints and defaults.
For MySQL, tools like pt-online-schema-change or gh-ost allow safe migrations without downtime. These work by creating a copy of the table, applying changes, and syncing data before swapping. Test in staging. Measure migration time.