Adding a new column sounds simple. In a small project, it is. In production at scale, it can be dangerous. Downtime, locked tables, migration failures — they can all happen if you treat it as an afterthought. The right approach keeps your system online, avoids data loss, and fits into continuous delivery.
First, decide if the new column belongs in the current table. Check normalization rules. Avoid adding columns that break logical separation of data. If it passes that check, choose the data type with care. The wrong type can break indexes, waste storage, or cause subtle bugs.
Next, plan the migration. In SQL, adding a nullable column with no default is safest. It commits fast and does not lock the table for long. Backfill the data in small batches to avoid blocking writes or overwhelming replicas. Use feature flags or conditional logic in your application code to read from the new column only after it is ready.