BeCuriouzBeCuriouz

Learn something new every day

☁️ Cloud & Infrastructure
🔵

How Netflix ships code without a scary "deploy" moment

💡 Blue-green deployment runs two identical environments so you can switch traffic to a new version instantly — and roll back just as fast by flipping back to the untouched old one.

Most outages don't happen at 3 a.m. — they happen right after someone hits "deploy." Blue-green deployment is a strategy that makes that moment boring. Instead of upgrading your live servers in place, you keep two identical production environments. One ("blue") serves all real traffic; the other ("green") sits idle. You deploy the new version to green, test it while no users are on it, then flip the router or load balancer to point everyone at green in one instant.

The real payoff is the rollback. If green misbehaves, you don't scramble to redeploy the old code — you just flip the router back to blue, which is still running the previous version untouched. Recovery takes seconds, not a stressful re-deploy. A close cousin, the canary deployment, sends only a small slice of traffic (say 5%) to the new version first, watching error rates before rolling it out to everyone.

The tradeoff is cost: you're paying to run two full environments at once, at least during the switch. In the cloud this is cheaper than it sounds — you can spin green up on demand and tear it down after — which is exactly why the pattern became popular.