Adding a new column to a database table looks simple in code. It is not always simple in production. The change can lock a table, spike latency, or trigger a cascade of failures in dependent services. Whether you use SQL or NoSQL, the wrong approach can bring down more than the database.
Start by defining the purpose of the new column. Decide on its data type, constraints, and default values before touching production. In relational databases, adding a nullable column is often faster because it avoids rewriting existing rows. In some systems, adding a column with a default forces a full rewrite, which can stall large tables.
For MySQL and PostgreSQL, use ALTER TABLE carefully. Test the migration on a replica with a copy of production data. Monitor execution time and disk I/O. On PostgreSQL, adding a new column without a default is a metadata-only change and executes instantly. On MySQL, newer versions handle this better, but always verify.