Adding a new column in a database can be simple, but doing it with zero downtime requires precision. In relational systems like PostgreSQL and MySQL, a quick ALTER TABLE ... ADD COLUMN works for small datasets. On massive tables, that same command can lock writes, block reads, and stall production. Planning matters.
Define the column with the exact type, constraints, and defaults you need. Avoid adding a default value on creation if the table is large; backfill in controlled batches to prevent performance hits. Use nullable columns when possible during rollout, then apply NOT NULL after a full data migration.
For distributed databases, verify replication lag and schema migration compatibility. Tools like pt-online-schema-change or native logical replication can help roll out schema changes without downtime. Ensure application code can handle the column being absent in some replicas during rollout.