Services

Resources

Company

/

Blue-green deployment

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. Once green passes its tests, the router or load balancer sends all traffic to green at once. Blue keeps running untouched, so going back is the same switch in reverse.

How it works

  1. Deploy v2 to green while blue serves users.

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

  3. Point the router at green. All traffic moves in one step.

  4. Leave blue on v1 until v2 has run cleanly under real traffic. Blue then becomes the target 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

Rolling back means pointing the router at the old environment again, which is quick because nothing has to be rebuilt or redeployed. 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

Diagram of a blue-green deployment: users reach a load balancer that sends 100% of traffic to the green environment running v2. The blue environment still runs v1, idle and ready for rollback, and both share one database whose schema must fit v1 and v2. In red, a dashed path shows that switching by DNS with a 300 second TTL leaves some users on blue for 5 minutes or more.

Putting this into practice?

Talk to One2N about our CI/CD services

Talk to One2N about our CI/CD services