Soru

Zorluk: ZorRelease Management and Deployment Strategies

An enterprise fintech organization runs a core payment processing service on Cloud Run backed by a Cloud Spanner database. The engineering team is preparing to deploy a major release that includes a database schema modification requiring a mandatory new column. The architecture must maintain zero downtime during deployment and ensure immediate rollback capability without data corruption or service errors if automated metrics detect anomalies. Which release strategy should the Cloud Architect recommend?

  1. Apply an expand-and-contract schema migration pattern by making the new database column optional, deploy the updated Cloud Run service revision using traffic splitting for a progressive canary release, backfill data, and contract the schema after full traffic migration.Cevap
  2. B
    Execute the breaking schema update directly in Cloud Spanner and immediately switch 100% of production traffic from the active Blue Cloud Run revision to the new Green Cloud Run revision using a standard Blue-Green deployment.
  3. C
    Migrate the payment microservice from Cloud Run to a dedicated regional Google Kubernetes Engine (GKE) cluster to execute Spanner DDL migrations using Kubernetes StatefulSet initContainers during pod creation.
  4. D
    Grant the primitive Project Owner IAM role to the deployment pipeline service account to execute database DDL updates and Cloud Run traffic routing simultaneously within a single script.

Cevap

Apply an expand-and-contract schema migration pattern by making the new database column optional, deploy the updated Cloud Run service revision using traffic splitting for a progressive canary release, backfill data, and contract the schema after full traffic migration.
The expand-and-contract pattern decouples database updates from application code releases by ensuring all database modifications are backward-compatible. Combined with Cloud Run traffic splitting, this permits safe progressive canary rollouts and instant rollbacks.

Adım Adım Çözüm

1
Expand the database schema with non-breaking changes
The new column is added to Cloud Spanner as optional/nullable, preserving compatibility with existing application code.
Ensures old and new application versions can operate concurrently against the same database state.
2
Deploy the new revision using Cloud Run traffic splitting
Traffic is gradually shifted to the new revision while health metrics and SLIs are continuously monitored.
Allows real-world verification with the ability to instantly roll back traffic without breaking active database sessions.
3
Contract the schema after retiring old application revisions
Backfill default values and alter the column to mandatory once 100% traffic is verified on the new revision.
Finalizes the database state cleanly without risking downtime or rollback errors.

Anahtar Kavram

Expand-Contract Database Schema Migration with Canary Traffic Shifting
Bu soruyu puanla