The schema is broken. You need a new column, and you need it without breaking production.
Adding a new column sounds simple, but the implications ripple through your database, application layer, and deploy pipeline. The right approach reduces downtime, prevents data loss, and keeps performance intact. The wrong one means corrupted migrations, blocking writes, or unexpected latency.
Start with the definition. In SQL, a new column alters a table’s structure. This is a schema change—a structural change that databases handle differently based on the engine. PostgreSQL locks less aggressively on small additions. MySQL can lock the table until the change finishes. For high-traffic systems, plan for this.
Use migrations under version control. Write them idempotent where possible so you can rerun them without error. Separate schema changes from data backfills. First, create the new column with NULL allowed. Then run background jobs to fill it. This isolates risk.
Default values deserve caution. In PostgreSQL, adding a default can rewrite the entire table if combined with NOT NULL. For large tables, make it nullable, backfill defaults in batches, then alter to NOT NULL if required.