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
A
running and serving traffic (let's call thisstarting point
stage) - until all instances of
A
are replaced with instances ofB
- repeat this:- a new instance of
B
is created, and once it's ready, it starts accepting traffic (create new
stage) - once that happens, 1 instance of
A
is killed (kill old
stage)
- a new instance of
During this process, the number of instances over time changes like this:
A
: 2B
: 0 (starting point
stage)A
: 2B
: 1 (aftercreate new
stage)A
: 1B
: 1 (afterkill old
stage)A
: 1B
: 2 (aftercreate new
stage)A
: 0B
: 2 (afterkill old
stage)
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: