Adding a new column sounds simple, but it can break production if handled poorly. Every table change rewrites data or blocks queries. On live systems, that can mean downtime, blocked writes, and angry users. The right approach makes it safe, fast, and reversible.
Start by defining the requirements. Know the data type, size, default values, and nullability of the new column. Avoid defaults that force a table rewrite unless you can tolerate the cost. For nullable columns, add them with no default first, then backfill in batches. For non-null requirements, seed data incrementally and then enforce constraints.
Plan the migration path. On most modern databases, adding a column without a default is cheap. Setting a default at creation may be fast for empty tables but risky for large datasets. Use ALTER TABLE in combination with feature flags or code-level guards to ensure that old code paths still run during the rollout.
For zero-downtime deployments, break changes into phases: