Adding a new column sounds simple. In reality, it can break production if done carelessly. The database has to handle existing data, default values, indexing, and constraints without causing downtime. The key is to design schema changes that can deploy online and work across rolling releases.
The first step is understanding the migration path. For relational databases like PostgreSQL or MySQL, adding a nullable column without a default is usually safe and fast. Adding a non-null column with a default can lock the table. To avoid that, add the column as nullable, backfill the data in batches, then set the NOT NULL constraint in a later migration.
Indexes should be created concurrently. For PostgreSQL, use CREATE INDEX CONCURRENTLY to keep write operations flowing. This avoids blocking queries during the migration. Always test the migration against realistic dataset sizes to measure execution time and verify rollback strategies.