Adding a new column to a database table sounds simple. It is not. Done wrong, it locks tables, halts writes, and pushes latency through the roof. Done right, it’s invisible to users and safe for production. The difference is in the method.
A new column often supports new features, tracks new metrics, or enables schema evolution. The key is introducing it without breaking existing code paths. For relational databases like PostgreSQL, the safest pattern is to add the column with a default of NULL first. Avoid setting a non-null default in the same operation on large tables. That can rewrite every row and block access.
In NoSQL systems, adding a new column—or attribute—can be as simple as writing new fields. But here too, consistency and backward compatibility matter. Application code must handle both old and new records during rollout. Run dual-read or dual-write strategies until the migration is complete.