An enterprise gaming company hosts its multiplayer matchmaking service on Google Cloud Run. The engineering team is executing a canary deployment strategy using Cloud Deploy to roll out a major version update with revision-based traffic splitting. Shortly after directing 10% of production traffic to the new revision, users assigned to the existing revision begin encountering severe database query failures because the release pipeline applied a breaking schema migration to Cloud SQL prior to traffic shifting. Which architectural modification should the cloud architect implement to enable zero-downtime releases during database schema updates?
- Implement an expand-contract (additive) schema migration strategy that retains existing database fields until all old application revisions are fully decommissioned.Answer
- BConfigure the deployment pipeline to execute destructive schema changes simultaneously with the initial 10% traffic split trigger.
- CReplatform the matchmaking microservice to Google Kubernetes Engine (GKE) Autopilot with an ingress service mesh to handle live database translation.
- DRequest an automated regional Cloud SQL vCPU quota increase in the pipeline stage immediately preceding the canary traffic split step.
Answer
Implement an expand-contract (additive) schema migration strategy that retains existing database fields until all old application revisions are fully decommissioned.
During canary and blue-green releases, multiple application versions run simultaneously and query the same shared database. Adopting an expand-contract (phase 1: expand additively, phase 2: deploy code, phase 3: contract old fields) schema migration strategy ensures complete backward compatibility, allowing older revisions to function without error while the canary revision is verified.
Step-by-Step Solution
Key Concept
Database schema backward compatibility in canary deployments (Expand-Contract Pattern)