When deploying a new release in a CD, the database migration is a sensitive operation. There are two main patterns, although there are a few other options :
- Blue/Green environment,
- decoupling of changes.
The workflow of the first pattern, Blue/Green environment, is:
- the Blue database is set to read-only mode;
- it is then saved;
- this backup is restored on the Green database;
- the traffic is then directed to the Green environment.
The limitation is that if a rollback is needed, transactions may be lost.
The second pattern, decoupling of changes, is much more simple: changes in the database and changes in the application are decoupled.
The limitations are that changes are limited to additions: modifications are not allowed.
- Pattern #1: Promote a step-by-step migration by using the Strangler application model
- Pattern #2: Testing dependencies
- Pattern #3: Single or multi-repository pattern
- Pattern #4: Data migration
- Pattern #5: Have the changes approved by people close to the problems
More articles on my blog http://www.DevOpsTestLab.com.
My LinkedIn profile: https://fr.linkedin.com/in/brunodelb