Adding a new column seems simple. It is not. In production systems, schema changes can cause lock contention, downtime, or data corruption if handled poorly. The right approach ensures zero downtime, preserves data integrity, and scales with traffic.
A new column in SQL or NoSQL is more than an extra field. It is a contract change between your storage layer and your application. The process begins by defining the column with the exact data type, default values, and nullability. In PostgreSQL, a new column with a default can rewrite the table, creating a performance hit. Using NULL with a later UPDATE or a computed migration can avoid this.
For MySQL, adding a column with ALTER TABLE can lock the table. Online schema change tools like gh-ost or pt-online-schema-change let you add the new column without blocking queries. In distributed databases, schema changes require careful rollout across replicas, with migrations executed in waves.