Solutions for non-stop service update applications: blue-green release, rolling release, and grayscale release

Original website: Solutions for updating applications without stopping service: blue-green release, rolling release, grayscale release

Introduction

This article introduces the solutions for updating applications without stopping the service: blue-green release, rolling release, and grayscale release.

When upgrading the application of the server, it is necessary to stop the service of the old version, upload the program to the server, and then start the new version. But there are problems with this method: the service is interrupted, users cannot use it, and the user experience is extremely poor.

Solution 1: Blue-green release

concept

Run two versions of the app at the same time. Do not stop the old version, directly deploy a new version, wait for the new version to run, and then switch the traffic to the new version.

advantage

  1. The release strategy is simple;
  2. Upgrade/rollback is fast.

shortcoming

  1. need more resources
    1. Blue-green deployment requires running two sets of programs at the same time during the upgrade process, and the hardware requirements are twice the daily requirements. For example, in daily operation, 10 servers are needed to support the business. If blue-green deployment is used, you need to purchase 20 servers.

schematic diagram

Option 2: Rolling release

meaning

During the upgrade process, instead of starting all new versions at once, start a new version first, then stop an old version, then start a new version, stop an old version until the upgrade is complete.

advantage

  1. Occupies less resources.
    1. If you need 10 servers daily, you only need 11 during the upgrade process.

shortcoming

  1. During the upgrade process, problems are found that are difficult to troubleshoot
    1. During the upgrade process, the old version and the new version run together. If a problem is found, it is difficult to determine whether the problem is caused by the new version or the old version.
    2. To solve this problem, we need to provide flow control capability for rolling upgrades.
  2. hard to roll back
  3. Slow deployment time;

schematic diagram

Solution 3: Grayscale release

meaning

Grayscale release is also called canary release. The origin is that mine workers discovered that canaries are very sensitive to gas. Miners will put a canary into the well before going down the well. If the canary stops calling, It means high gas concentration.

When grayscale is released, a new version of the application is launched first, but the traffic is not cut directly, but the testers conduct online tests on the new version, and the launched new version of the application is our canary. If there is no problem, you can import a small amount of user traffic to the new version, and then observe the running status of the new version and collect various runtime data. If you compare various data between the old and new versions at this time, it is the so-called A /B test.

After confirming that the new version is running well, gradually import more traffic to the new version. During this period, the number of running server copies of the old and new versions can be continuously adjusted so that the new version can withstand the increasing traffic. High flow pressure. Until 100% of the traffic is switched to the new version, and finally the remaining old version services are closed to complete the grayscale release.

If a problem with the new version is found during the grayscale release process (greyscale period), the traffic should be switched back to the old version immediately, so that the negative impact will be kept to a minimum.

advantage

  1. Occupies less resources.
    1. If you need 10 servers daily, you only need 11 during the upgrade process.
  2. If a problem occurs, the scope of influence is small, so the user experience is also good;

shortcoming

  1. A certain amount of code is required
    1. Need to request traffic to the new service based on the user.

schematic diagram

Guess you like

Origin blog.csdn.net/feiying0canglang/article/details/128986966