Soru

Zorluk: OrtaRelease Management and Deployment Strategies

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?

  1. 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.Cevap
  2. B
    Execute the database schema alteration directly during the green deployment phase while temporarily locking tables to synchronize state between blue and green instances.
  3. C
    Grant 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.
  4. D
    Store database migration state files in unversioned local container storage to allow each Cloud Run revision to manage its own schema independently.

Cevap

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.

Adım Adım Çözüm

1
Analyze the cause of the failure during the blue-green deployment.
Identified that breaking database schema updates (removing columns) broke the running blue revision while both revisions were active.
Blue-green deployments require both blue and green application revisions to operate concurrently against the shared database during traffic migration.
2
Design a multi-phase database migration strategy.
Adopted the expand-and-contract pattern to decouple database migrations from application code deployments.
Expanding the schema (adding new columns without removing old ones) keeps the database backward-compatible with the blue application version.
3
Finalize the release lifecycle.
Contract (clean up) the legacy schema elements only after all traffic has migrated to the green revision.
Deferred removal of old schema elements prevents breaking active versions during traffic transition.

Anahtar Kavram

Decoupled Database Schema Migrations (Expand-and-Contract Pattern) in Blue-Green Deployments
Bu soruyu puanla