Adding a new column is more than a schema change. It’s an operation that touches performance, data integrity, and deployment strategy. The wrong move can lock rows, spike CPU usage, or break downstream processes. The right move slips into production cleanly, without a whisper.
Start with clarity on why you need the column. Define its type precisely: integer for counters, UUID for identifiers, timestamp for logging events. Keep nullability explicit. If data must exist for every record, enforce NOT NULL from the start. Avoid default values that mask bad input.
Plan for migration. On large datasets, adding a column with a default can force a full table rewrite. Instead, create the column without defaults, then backfill in small batches. Use transactions to keep changes atomic, but keep them short to prevent lock contention.