An enterprise SaaS platform hosts an AI-powered data processing service on Google Kubernetes Engine (GKE) backed by Cloud SQL for PostgreSQL. The team needs to execute a zero-downtime release that includes both a non-breaking database schema modification and a new application version deployment using a canary release strategy. What is the correct sequence of operational steps to perform this release safely?
- 1Apply additive, backward-compatible database schema changes (Expand phase) to support both the existing and new application versions.
- 2Deploy the new application version to a designated canary workload target on GKE alongside the existing deployment.
- 3Configure GKE Gateway / Service Mesh traffic splitting to route 5% of production traffic to the canary deployment and monitor telemetry.
- 4Promote the new application version to handle 100% of production traffic and decommission the legacy application pods.
- 5Execute destructive database schema cleanup changes (Contract phase) to remove deprecated tables or columns.
Cevap
The correct sequence starts with applying backward-compatible additive database changes, followed by deploying the canary application workload to GKE, routing a small fraction of traffic for monitoring, promoting the release to 100% traffic while decommissioning old pods, and finally executing destructive database cleanup changes.
To achieve zero downtime during releases involving database schema changes, the Expand-Contract pattern must be used. First, the database schema is updated additively so both old and new code function correctly. Next, the canary release is deployed to GKE and assigned a small fraction of traffic via GKE Gateway / Service Mesh traffic splitting. Once validated, the new version is fully promoted to serve 100% of production traffic and old pods are retired. Only after all old code is completely decommissioned can destructive contract schema changes be safely applied.
Adım Adım Çözüm
Anahtar Kavram
Expand-Contract Database Schema Migration paired with Canary Deployment
Tahmini Süre:1m 30s