Database migrations
An unavoidable fact of development is that software systems are always changing. While the pace of changes in the database is typically not as fast as other areas, there are still changes and they need to be treated carefully.
Data changes are roughly categorized into two different kinds:
- Format or schema changes: New elements, like fields or tables, to be added or removed; or changes in the format of some fields.
- Data changes: Requiring changing the data itself, without modifying the format. For example, normalizing an address field including the zip code, or making a string field uppercase.
Backward compatibility
The basic principle related to changes in the database is backward compatibility. This means that any single change in the database needs to work without any change in the code.
This allows you to make changes without interrupting the service. If the changes in the database require a change in the code...