Soru

Zorluk: OrtaRelease Management and Deployment Strategies (Blue-Green, Canary, Rolling)

A connected vehicle technology provider operates an API service on Google Cloud Run backed by Cloud SQL for PostgreSQL. The engineering team needs to release a new version of the microservice that introduces a schema modification adding a new column required by the application. The release must guarantee zero downtime and allow seamless immediate rollback to the previous Cloud Run revision if anomalies occur during deployment. Which deployment and database migration strategy should the Cloud Architect recommend?

  1. A
    Immediately apply the database schema update introducing the required column, then execute a blue-green traffic switch to the new Cloud Run revision.
  2. Apply an expand-contract schema pattern by adding the new column as optional first, deploy the new Cloud Run revision using revision traffic splitting for canary testing, backfill the data, and update the column constraint after verifying release stability.Cevap
  3. C
    Migrate the microservice deployment from Cloud Run to a Google Kubernetes Engine (GKE) cluster to use GKE Native Ingress traffic management for the release.
  4. D
    Provision a duplicate Cloud SQL instance with the new schema, perform a blue-green endpoint cutover, and submit a regional quota increase request after the cutover if resource utilization spikes.

Cevap

Apply an expand-contract schema pattern by adding the new column as optional first, deploy the new Cloud Run revision using revision traffic splitting for canary testing, backfill the data, and update the column constraint after verifying release stability.
To achieve zero downtime and maintain immediate rollback capabilities during release management, database updates must follow the expand-contract pattern. Adding new fields as optional (nullable) ensures that the currently running version of the service remains fully operational while the new revision is deployed to Cloud Run. Cloud Run natively supports splitting traffic between revisions to perform canary testing. Once the new revision is validated and receiving 100% of traffic, data backfilling and schema constraints can be finalized safely.

Adım Adım Çözüm

1
Ensure database schema backward compatibility using the expand-contract pattern
Both the legacy application revision and the new application revision can query the database without errors.
During canary deployments or blue-green switches, multiple application versions run simultaneously against the shared database.
2
Deploy the new revision to Cloud Run and split traffic
Gradual canary testing (e.g., 10% traffic to new revision, 90% to old revision) is established.
Cloud Run supports native revision traffic splitting without needing additional compute infrastructure like GKE.
3
Complete data backfill and contract the schema
The new column constraint is enforced once all active traffic uses the new application version.
Completes the migration safely without disrupting live operations or preventing instant rollback during testing.

Anahtar Kavram

Database Backward Compatibility in Canary and Blue-Green Deployments (Expand-Contract Pattern)
Bu soruyu puanla