Adding a new column should be simple. In production, it can be dangerous. The size of the table, the data type, the constraints — each choice can affect performance, replication lag, and downtime. A careless ALTER TABLE can block writes for minutes or hours. A careful one can roll out with zero disruption.
First, decide if the new column can have a default value. In many databases, adding a column with a non-null default rewrites the entire table. For large datasets, this can stall the app. One safe pattern: add the column as nullable without a default, then backfill it in small batches, then enforce constraints.
Second, understand your database engine’s behavior. PostgreSQL handles certain new column operations without table rewrites. MySQL may still lock. Cloud-managed databases can introduce their own quirks. Always test in a staging copy that mirrors production scale.