All terms

Glossary

Expand and contract

Also: Parallel change

A procedure for database changes without downtime: expand first, switch second, remove the old thing last.

Renaming a column sounds harmless and is the classic cause of deployment outages, because old and new code run at the same time for a moment. Expand and contract solves this in three steps spread over several releases.

First the new column is added and written to as well. Then the reading side is switched. Only when no code needs the old column is it removed.