Liquibase and Zero-Downtime Deployments: Managing Schema Evolution Phases
0 reputation · 18 Oct 2021, 02:43 UTC
Implementing a zero-downtime migration strategy requires coordinating database schema changes with application code deployments. To avoid breaking the running application, schema evolution must be split into additive and destructive phases.
The goal is to ensure that the database supports both the current version of the application and the next version simultaneously during the rollout. This typically involves adding new columns or tables before updating the application logic, and removing deprecated elements only after the new version is fully stable.
When using Liquibase to automate these transitions, it is unclear how to best structure the changelog to prevent destructive operations from executing prematurely in a CI/CD pipeline without manually editing the changelog for every environment.
- How can Liquibase contexts or labels be leveraged to decouple additive changes from destructive cleanup tasks across multiple deployment stages?
- What is the recommended approach for ensuring a destructive changeSet only executes after a successful application health check?