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

Comic about blue-green deployment: a shop runs live on the blue copy while green holds the new version idle; after testing green, one router switch moves 100% of users to it in seconds; when green shows errors, the switch flips back to blue in seconds; the team gets a release with instant undo, pays for two copies of the servers for a while, and needs a database that works for both.