This is a part of system design knowledge base. In this article, we’ll discuss production code deployment strategies.
To deploy an application code, there could be multiple strategies, depending on a business need. Here are few common deployment strategies:
Below two are full deployment strategies in that we deploy the compete code base or services into the production.
- Multi-Service deployment: In this deployment strategy, we deploy all services within an environment (or a node). An example could be a single full deployment into a monolithic environment. The downside of this deployment is that it’s difficult to rollback.
- Blue-Green deployment: In this deployment strategy, we keep a staging environment. Production code is moved to staging and new code is deployed to production. In case of the rollback situation, we can migrate codebase from staging to production.
Below two are partial deployment strategies in that we deploy the partial code base or services into the production. That means, we do not change entire services or codebase for all the users. Let’s refer to two types of partial deployments below:
- Canary deployment: I also call it a pilot or a beta program deployment. In this deployment strategy, we release the new services to a smaller user base. Beta program could be an example of canary deployment.
- A/B deployment: In this deployment strategy, we release new features to some users as an experimental release.
- Difference in Canary and A/B deployments: The intent of canary deployment is mitigating the risks by releasing new services to some users. If some selected users are able to. use a new service as expected, we can release the service to rest all users. However, the intent of A/B testing is to experiment a new feature or a service with some users, to learn the success of a new feature or a service.