An enterprise organization is deploying a major application update to a microservice hosted on Google Cloud Run that interacts with a Cloud SQL for PostgreSQL database. During a blue-green deployment, the team executes a database migration script that removes deprecated table columns required by the existing (blue) version as soon as the new (green) version is deployed. As a result, users routed to the blue deployment experience high error rates during the rollout. Which release management strategy should the cloud architect implement to prevent service disruptions during future database migrations?
- Implement an expand-and-contract database migration pattern that ensures schema modifications remain backward-compatible with the active blue version until the green version is fully deployed.Answer
- BExecute the database schema alteration directly during the green deployment phase while temporarily locking tables to synchronize state between blue and green instances.
- CGrant the primitive Owner role to the CI/CD pipeline service account so it can force database lock overrides and apply schema updates immediately before traffic splitting.
- DStore database migration state files in unversioned local container storage to allow each Cloud Run revision to manage its own schema independently.
Answer
Implement an expand-and-contract database migration pattern that ensures schema modifications remain backward-compatible with the active blue version until the green version is fully deployed.
The correct answer emphasizes using the expand-and-contract (or parallel run) database migration pattern. When performing zero-downtime releases such as blue-green deployments, both older and newer application instances must run concurrently against the shared database. Decoupling schema changes into backward-compatible steps ensures that the active blue version continues functioning normally while the green version is validated.
Step-by-Step Solution
Key Concept
Decoupled Database Schema Migrations (Expand-and-Contract Pattern) in Blue-Green Deployments