Adding a new column should be simple. In practice, it can break builds, stall deployments, and corrupt data when done wrong. The key is precision. You need to define the schema change, control the rollout, and guard data integrity.
Start with the database. Use ALTER TABLE with explicit constraints. Set defaults for non-nullable fields. Avoid adding indexes during peak load; they can lock rows and block writes. Schedule schema updates during maintenance windows or run them with online migration tools.
In application code, handle the new column before it exists. Deploy code that can work without it, then add the column, then enable the feature. This two-step deploy prevents downtime. Backfill data in small batches to avoid locking and transaction runaway.