Blue/Green is a Deployment StrategyDeployment Strategy
Deployment strategies describe how we handle the release of the new code to an environment. Each has it's different use case, pros and cons.
Here is a (non-definitive) list of deployment strategie... where version B
is deployed alongside version A
, after which the traffic is switched from A
to B
.
How it works
- before we start, we have 2 instances of
A
running and serving traffic - we deploy 2 instances of
B
alongside them, which are still not serving any traffic - we confirm that version
B
deployment looks good - we switch traffic flow from version
A
to versionB
on Load Balancer side
Tradeoffs
Pros:
- zero downtime
- instant rollout and rollback
- entire application is changed in one go, no different api versions running at the same time
Cons:
- it expects us to run 2 identical environments alongside one another, which can be expensive
- it doesn't make much sense to run two databases, so you have to figure out how to run both versions connected to a single database (backwards-compatible db updates, decoupled db migrations from application deployment)
Status: #💡
References: