Adding a new column in a database is one of the most common schema changes, but it can destroy performance or lock production if done wrong. Whether you use PostgreSQL, MySQL, or a cloud-managed service, the way you define, populate, and deploy a new column determines how smooth the migration will be.
Plan the schema change before you touch the database. Check row count, indexes, and replication lag. For large tables, avoid ALTER TABLE ... ADD COLUMN without defaults, or use a NULL default to bypass table rewrites. Add constraints and indexes only after the column exists, so you keep the initial change lightweight.
For backfills, run incremental updates. Use batched UPDATE statements or background workers to fill the new column without hammering I/O. Make sure write paths handle both old and new schemas until the backfill completes. In distributed systems, ensure versioned code works with either schema state to avoid deployment deadlocks.