Adding a new column to a database sounds trivial. It is not. The wrong approach locks tables, stalls writes, and takes your system offline. The right approach changes schema in production without downtime and without corrupting data.
Start with clarity. Know exactly why you need the new column and what type it requires. Avoid default values on large tables during the initial alter; they force a full rewrite of the existing rows. Add the column as nullable first. Commit that migration and let it run.
Once the column exists, backfill in small, controlled batches. Throttle your writes to avoid pressure on the primary database. Use a job queue or a migration tool with built‑in batching. Monitor latency closely. If you see spikes, slow down.
When backfill completes, add constraints, defaults, or indexes in separate operations. Each step is isolated. Each step can be rolled back or retried without risking the entire table.