Adding a new column sounds simple. In production, it can be a landmine. You touch the database, migrations run, and every connection slows. If the application serves live traffic, users feel it. The wrong ALTER TABLE statement can lock rows for hours.
A new column in PostgreSQL, MySQL, or any SQL database should not be an afterthought. Understand the storage method. If the column has a default value, some engines rewrite the entire table. If it’s NULL by default, you can sometimes add it instantly. On large datasets, this difference determines if your deployment is smooth or a disaster.
Zero-downtime strategies are essential. You can create the column without defaults, backfill in small batches, and then set constraints. Use tools like pt-online-schema-change or gh-ost for MySQL. PostgreSQL 11+ supports fast-add columns without table rewrites for NULL defaults, but older versions need careful planning.