Soru

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

Your organization is executing a zero-downtime canary deployment for a critical payment-processing microservice on Google Kubernetes Engine (GKE) backed by Cloud SQL for PostgreSQL. The deployment requires adding a mandatory database column without causing application downtime or transaction failures for live users. Sequence the operational steps in the correct order to safely complete this deployment strategy.

  1. 1Apply an additive DDL migration (Expand phase) to add the new database column as optional (nullable) without default value enforcement.
  2. 2Deploy the updated microservice build using Google Cloud Deploy and configure a canary strategy to route 10% of user traffic to the new revision.
  3. 3Promote the updated microservice revision to receive 100% of production traffic in Google Cloud Deploy following successful canary verification.
  4. 4Apply a destructive/restrictive DDL migration (Contract phase) to alter the new column to NOT NULL and remove any obsolete columns.

Cevap

The proper sequence follows the expand-contract deployment pattern: first, perform an additive database migration to add the column as nullable; second, initiate a canary deployment with partial traffic shifting; third, promote the release to 100% traffic upon validation; and fourth, finalize the contract phase by applying the NOT NULL constraint to the database column.
Safely deploying application updates dependent on database schema changes requires decoupled, backward-compatible steps. The additive schema migration (Expand) must precede canary traffic shifting. Once the canary release is validated and promoted to 100% traffic across all instances, restrictive schema changes (Contract) can be safely applied.

Adım Adım Çözüm

1
Execute Expand DDL Migration
The new column is added as nullable to the database schema.
Existing application instances running version 1 do not supply data for the new column and would crash if strict non-null constraints were enforced prematurely.
2
Deploy Canary Revision and Route Partial Traffic
Version 2 microservice receives 10% of traffic via GKE ingress/Cloud Deploy orchestration.
Allows real-world metric evaluation of version 2 without exposing the entire user base to potential release defects.
3
Promote Version 2 to Full Production Traffic
100% of incoming requests are handled by version 2 instances.
Ensures complete transition off legacy version 1 code before locking down schema contracts.
4
Execute Contract DDL Migration
Column schema is updated to NOT NULL and deprecated fields are cleaned up.
Maintains database data integrity once all active workload instances write compliance data.

Anahtar Kavram

Expand-Contract (Parallel Change) Pattern for Database Zero-Downtime Releases
Bu soruyu puanla