Soru

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

An enterprise HR platform operates a critical payroll processing service deployed across Compute Engine Regional Managed Instance Groups (MIGs) behind an External HTTP(S) Load Balancer, backed by Cloud SQL for PostgreSQL. The engineering team must execute a major release containing breaking database schema alterations (column renaming) while maintaining zero downtime and ensuring immediate rollback capabilities if anomalies are detected. Which deployment and database migration approach should you recommend?

  1. Implement an expand-contract database schema migration strategy to maintain backward compatibility, and perform a blue-green application deployment by shifting traffic between MIG backend services at the load balancer level.Cevap
  2. B
    Apply the non-backward-compatible database schema updates directly to the live Cloud SQL instance, then trigger a rolling update across the existing Managed Instance Group.
  3. C
    Migrate the entire application workload from Compute Engine MIGs to a multi-zonal Google Kubernetes Engine (GKE) cluster with Anthos Service Mesh to manage canary traffic splitting before modifying the database schema.
  4. D
    Provision a new parallel green MIG with maximum target capacity without pre-checking project quotas, modify the database schema, and update the DNS A-record to direct user traffic to the new instances.

Cevap

Implement an expand-contract database schema migration strategy to maintain backward compatibility, and perform a blue-green application deployment by shifting traffic between MIG backend services at the load balancer level.
Executing a zero-downtime release with breaking database modifications requires combining the Expand-Contract database pattern with Blue-Green traffic routing. The expand-contract strategy ensures that both old and new application instances can read/write to the database concurrently during rollout. Utilizing Google Cloud's HTTP(S) Load Balancer to switch traffic between the Blue and Green backend services provides instantaneous cutover and immediate rollback capabilities without DNS caching delay.

Adım Adım Çözüm

1
Decouple database migration from application release using the Expand-Contract pattern.
Database changes are split into three phased migrations (Expand: add new column alongside old column; Transition: sync data and write to both; Contract: remove old column only after legacy version is decommissioned).
This guarantees that both old (Blue) and new (Green) application code paths can run concurrently against the database without errors.
2
Deploy the new application version to a separate (Green) Regional Managed Instance Group.
The green environment runs completely isolated alongside the production blue environment.
Creating isolated target environments enables full validation prior to routing live end-user traffic.
3
Configure the HTTP(S) Load Balancer to perform weighted traffic shifting between backend services.
Traffic cutover happens seamlessly at the load balancer layer, providing immediate rollback capabilities if health metrics degrade.
Load balancer backend switching provides instantaneous traffic migration without waiting for DNS TTL propagation.

Anahtar Kavram

Blue-Green Deployment and Expand-Contract Database Schema Migration
Bu soruyu puanla