Deployment strategies
date
Mar 25, 2021
slug
deployment-strategies
status
Published
tags
operation
devops
summary
Deploying or upgrading services is risky. In this post, we explore risk
mitigation strategies.
type
Post
๐๐ฎ๐ฅ๐ญ๐ข-๐๐๐ซ๐ฏ๐ข๐๐ ๐๐๐ฉ๐ฅ๐จ๐ฒ๐ฆ๐๐ง๐ญ
In this model, we deploy new changes to multiple services
simultaneously. This approach is easy to implement. But since all the
services are upgraded at the same time, it is hard to manage and test
dependencies. Itโs also hard to rollback safely
๐๐ฅ๐ฎ๐-๐๐ซ๐๐๐ง ๐๐๐ฉ๐ฅ๐จ๐ฒ๐ฆ๐๐ง๐ญ
With blue-green deployment, we have two identical environments: one is staging (blue) and the other is production (green). The staging
environment is one version ahead of production. Once testing is done in the staging environment, user traffic is switched to the staging
environment, and the staging becomes the production. This deployment strategy is simple to perform rollback, but having two identical production quality environments could be expensive.
๐๐๐ง๐๐ซ๐ฒ ๐๐๐ฉ๐ฅ๐จ๐ฒ๐ฆ๐๐ง๐ญ
A canary deployment upgrades services gradually, each time to a
subset of users. It is cheaper than blue-green deployment and easy to
perform rollback. However, since there is no staging environment, we
have to test on production. This process is more complicated because
we need to monitor the canary while gradually migrating more and
more users away from the old version.
๐/๐ ๐๐๐ฌ๐ญ
In the A/B test, different versions of services run in production simultaneously. Each version runs an โexperimentโ for a subset of users. A/B test is a cheap method to test new features in production.
We need to control the deployment process in case some features are pushed to users by accident.