Home/Labs/Blue-Green Cutover Board
All 280 Labs
INTERACTIVE LAB🔁

Blue-Green Deployment Lab (Interactive)

Walk a release across dual environments and break the shared database on purpose. Advance deploy, smoke test, Expand-Contract migration, atomic cutover, and contract stages while the board prices standby time and rollback speed.

Blue-Green State Machine & Expand-Contract Gate

Walk a release through dual environments. Break the rules on the shared database and find out which side crashes.

BLUE (v1.0)100% LIVE TRAFFIC
GREEN (v1.1)IDLE STANDBY
Shared persistence: phone_num (single column)
Lifecycle stage0/6
Mixed-version serving window0s (atomic flip)
Extra 2x infra cost$270 (13.5h)
Rollback MTTR now<1s

IDLE — Blue v1.0 live, Green provisioned on demand

ROUTER / PIPELINE EVENTS:

› Idle: Blue v1.0 serves 100% of 100,000 QPS. Green is a copy of prod, waiting.

How It Works Under the Hood

Blue-green keeps two complete production environments and a router pointer: traffic moves from Blue v1.0 to Green v1.1 in one atomic sub-100ms flip, so there is no minutes-long mixed-version state, and rollback is simply flipping back to the warm Blue fleet for MTTR under a second. The hard part is the shared database: both versions must speak the same schema, which is why migrations go expand (add nullable column, dual-write), cut over, then contract (drop the old column) only after Blue is decommissioned. Skip it and one side of the fleet starts throwing column-not-found against live traffic.

Core Architectural Principles

  • Atomic router pointer flip means zero partial-deployment states, unlike rolling updates' long mixed fleets.
  • Instant rollback exists only while the standby is warm — keep Blue for a chosen window, then tear down.
  • Expand-Contract keeps the shared schema backward compatible across both versions; paused Green consumers avoid double processing.
Interview Round Script

Contrast blue-green with rolling and canary by rollback semantics: pointer flip is sub-second while rolling back a fleet costs 5-15 minutes. Then prove you know the trap — the shared persistence tier — by walking Expand-Contract phases and the Kafka double-consumption hazard, and defuse the cost objection with ephemeral Terraform-provisioned Green node groups.

Key Trade-Offs

Instant atomic cutover and sub-second rollback versus 2x compute during the standby window and strict schema-migration discipline.

Related Curriculum Chapter

Blue-Green Deployments: Instant Router-Level Switching

Read Full Chapter Blueprint

Explore More Interactive Labs

View All 280 Labs