About the deployment strategy
Tags: deployment, release
Published: 2023-06-22 02:37:18

This article is a translation of [デプロイ戦略について](https://bmf-tech.com/posts/%e3%83%87%e3%83%97%e3%83%ad%e3%82%a4%e6%88%a6%e7%95%a5%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6).

# Summary
Summarize the deployment strategy.

# Definitions of Deploy, Release, and Rollback
To clarify the definition of the term as a prerequisite knowledge of the deployment strategy.

Deploy means "to place an executable program in an execution environment".
Release means "to make the program ready for user access".
Rollback means "to release an older version of a release".

# Types of Deployment Strategies
We will cover what we consider to be the most typical.

## In-place deployment
A method of deploying a new version directly to an existing environment.

As a side note, bmf-tech.com uses docker-compose, but the deployment is in-place deployment....
cf. [bmf-techを支える技術](https://bmf-tech.com/posts/bmf-tech%e3%82%92%e6%94%af%e3%81%88%e3%82%8b%e6%8a%80%e8%a1%93#5-%E3%83%87%E3%83%97% E3%83%AD%E3%82%A4)

## Symbolic Link Deployment
A method of switching between old and new versions using symbolic links.

## Blue-green deployment
A method of preparing two environments, one blue and one green, deploying the new version to one of them and temporarily deploying both the old and new versions.
If there are no problems with the new version, switch traffic from the old version to the new version.
The blue and green environments are preserved respectively.

## Immutable Deploy
Same method as Blue-Green, except that the old environment is deleted after the traffic is switched.

## Rolling Deployment
A method in which new versions are deployed and released in fixed numbers.
Traffic to both the old and new environments remains available until all the new versions have been deployed.

## Canary Deployment
A method of deploying and releasing a new version only partially, in such a way that the new version can be deployed to only a subset of users and traffic.

## Deployment Strategy Perspective Table
For each deployment strategy, pick up the perspectives that may be important when selecting one, and summarize them in the table below.

| Deployment method | Zero downtime | Production environment testing | Rollback time | Operational cost
| -------------------------- | ---------------- | ---------------- | ------------------------------------ | ---------- |
| In-place Deployment | x | x | High | Low
| Symbolic Link Deployment
| Bluegreen Deployment | ○ | ○ | Low (still low before and after traffic switchover) | High
| Immutable Deployment | ○ | ○ | Low (only until the old environment is deleted) | High
| Rolling Deployment | ○ | × | Low | Medium
| Canary Deploy | ○ | ○ | Medium | High

- Zero downtime
  - Whether or not a service outage occurs during deployment
  - ○ if zero downtime is possible, ✗ if not
- Test in production environment
  - Whether traffic can be routed to the new version
  - ○ if possible, ✗ if not possible
- Rollback time
  - High/low time cost required for rollback
  - Judged as low, medium, or high
- Operational cost
  - High/low operational cost to organize the deployment methodology
  - High/Low/Medium/High

# Release strategy
- [Deploy / Release Methodology Summary](https://garafu.blogspot.com/2018/11/release-strategy.html)
- [What does build / deploy / release / rollback mean and what are the differences](https://garafu.blogspot.com/2018/11/build-deploy-release-rollback.html)
- [What is Deploy?](https://cmc-japan.co.jp/blog/%E3%83%87%E3%83%97%E3%83%AD%E3%82%A4%E3%81%A8%E3%81%AF/)
- [Application Deployment and Testing Strategies](https://cloud.google.com/architecture/application-deployment-and-testing-strategies?hl=ja)
- [Software Deployment](https://ja.wikipedia.org/wiki/%E3%82%BD%E3%83%95%E3%83%88%E3%82%A6%E3%82%A7%E3%82%A2%E3%83%87%E3%83%97%E3%83%AD%E 3%82%A4%E3%83%A1%E3%83%B3%E3%83%88)