Services

Resources

Company

Blue-green deployment

Blue-green deployment is a release strategy that keeps two identical production environments. One, say blue, serves all live traffic. The new version is deployed and tested on the idle green environment. A router or load balancer then switches traffic to green in one step, and blue stays ready as an instant rollback.

How it works

  1. Deploy v2 to green while blue serves users.

  2. Run smoke tests against green through an internal address.

  3. Switch the router, so 100% of traffic moves to green.

  4. Keep blue running until v2 is proven, then reuse it for the next release.

A switch at the load balancer takes seconds. A switch through DNS waits for cached records to expire, so with a 300-second TTL some clients reach blue for at least 5 minutes, and longer if they ignore the TTL.

Why it matters in production

Rollback is a router change, not a redeploy, which shortens recovery. The price is double capacity during the release, and a database both versions can use, so schema migrations must stay backward compatible. Unlike a canary deployment, every user moves at once, so a problem that only appears under full load hits everyone.

See also

On the One2N blog

Further reading

Four-panel comic about Blue-green deployment: Blue runs v1 and serves 100% of users. v2 is deployed to the idle green environment and smoke tested; The router flips: 100% of traffic moves from blue to green in seconds; Errors spike on green, so Asha flips back to blue in seconds. The cost:...