Rolling Update 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... (also known as Ramped or Incremental), where we slowly replace version A with version B.
How it works
- before we start, we have 2 instances of
Arunning and serving traffic (let's call thisstarting pointstage) - until all instances of
Aare replaced with instances ofB- repeat this:- a new instance of
Bis created, and once it's ready, it starts accepting traffic (create newstage) - once that happens, 1 instance of
Ais killed (kill oldstage)
- a new instance of
During this process, the number of instances over time changes like this:
A: 2B: 0 (starting pointstage)A: 2B: 1 (aftercreate newstage)A: 1B: 1 (afterkill oldstage)A: 1B: 2 (aftercreate newstage)A: 0B: 2 (afterkill oldstage)
The example above replaces instances one at a time - we could configure this to be done with multiple instances in parallel.
During the deployment, our number of active instances is always between the desired count and (desired count + number of new instances rolling out at the same time).
Tradeoffs
Pros:
- zero downtime
- pretty easy and cheap to execute
Cons:
- rollouts and rollbacks can last a long time (depending on number of instances and startup time)
- during deployment, some users will be served old version, some new version - we have no control over this aspect
Status: #💡
References: