Schema changes look simple. Add a column, run the migration, ship the code. But in production, the smallest shift can lock tables, block writes, and create downtime. The risks rise with table size, concurrent writes, and replication lag.
Adding a new column in SQL changes both metadata and, sometimes, the data layout. In MySQL, ALTER TABLE can rebuild an entire table. In PostgreSQL, adding a nullable column with a default value before version 11 rewrites each row. Even safe-looking defaults can cascade into hours of blocked queries.
Safe schema changes depend on three things: reducing lock time, controlling replication impact, and coordinating code with data updates. For large tables, use tools like pt-online-schema-change or built-in features such as PostgreSQL’s ALTER TABLE ... ADD COLUMN without default values, followed by a background update. In staged deployments, release the new column as nullable, backfill in batches, then apply constraints and defaults later.