Blue-Green Deployments

Blue-green is "run two parallel environments; switch traffic from one to the other." It's a deployment strategy with strong rollback guarantees — if the new version misbehaves, switch back, instantly.

The strategy has lost ground to canary / progressive delivery as the dominant pattern, but it's still the right answer in specific cases.

How it works

Two production environments — "blue" and "green" — both capable of serving real traffic. Only one is live at a time.

Today:    Blue (v1.0) → live traffic
          Green (v2.0) → idle, deployed

Switch:   Blue (v1.0) → idle  
          Green (v2.0) → live traffic   ← cut over via load balancer

Tomorrow: Green (v2.0) → live traffic
          Blue (v3.0) → idle, deployed

Mechanism: a load balancer or DNS swap routes traffic. The "switch" is fast (seconds to minutes); rollback is the same swap in reverse.

What it gets right

What it costs

When blue-green wins

When canary wins

For most modern web applications, canary deployment beats blue-green:

Canary requires:

Most modern teams use canary or some progressive delivery system (LaunchDarkly, Argo Rollouts, Flagger). Blue-green has become a niche.

Hybrid: blue-green for infrastructure, canary for code

A common shape:

This combines the strengths. The infrastructure swap is rare and atomic; application changes are gradual and reversible.

Database considerations

Blue-green is hardest on databases. Both environments share the same database; schema changes affect both.

The discipline:

A naive blue-green where the database migrates during the switch produces broken state. Plan migrations to land before the application change.

Cutover patterns

The "switch" can be:

For Kubernetes specifically, blue-green is implemented via two Deployments and a Service whose selector switches. Tools (Argo Rollouts, Flagger) automate the switch and the validation.

Traffic-shifting strategies

Variations on the cutover:

Stepped switching with automated rollback on bad metrics is the closest blue-green gets to canary's gradient.

Failure modes

Tools

For new Kubernetes deployments: pick Argo Rollouts or Flagger; both work; pick based on your service mesh.

What I'd actually recommend

For a typical modern team:

  1. Start with rolling deployments — Kubernetes' default. Cheap, decent, good enough for most cases.
  2. Add canary for high-stakes services — payment, auth, anything customer-facing. Argo Rollouts or Flagger.
  3. Reserve blue-green for cases where canary doesn't fit — major infrastructure changes, environments where partial rollouts don't work.

Blue-green isn't dead; it's just not the default anymore.

Further reading