Blue-Green Deployment

Blue-Green Deployment is a release strategy that maintains two identical production environments and switches all traffic from one to the other when a new version is ready. The currently live environment is "blue"; the new version is staged in "green"; when green is verified, a single traffic switch makes green live and blue idle (and available as instant rollback).

How it works

Two complete environments run side-by-side. New versions deploy to the inactive one (green) while traffic continues to flow to the active one (blue). After smoke tests and warm-up on green, a load balancer or DNS change cuts traffic over. Rollback is symmetric: flip back to blue.

When it fits

  • Stateless services where two parallel environments are affordable
  • Releases that need fast, atomic rollback
  • Cases where mixed-version traffic during a rollout is unacceptable (incompatible schema changes, breaking protocol updates)

Tradeoffs vs canary

  • Blue-green. Atomic switch, simple to reason about, doubles infrastructure cost during transitions, no gradual exposure.
  • Canary. Gradual rollout, smaller blast radius, more complex traffic shaping, mixed-version state during rollout.

Subscribe to Sahil's Playbook

Clear thinking on product, engineering, and building at scale. No noise. One email when there's something worth sharing.
[email protected]
Subscribe
Mastodon