官术网_书友最值得收藏!

Allowing co-existence of different versions

Since microservices package the service runtime environment along with the service itself, it enables multiple versions of the service to coexist in the same environment.

There will be situations where we will have to run multiple versions of the same service at the same time. Zero downtime promote, where one has to gracefully switch over from one version to another, is one example of such a scenario, as there will be a time window where both services will have to be up and running simultaneously. With monolithic applications, this is a complex procedure, since upgrading new services in one node of the cluster is cumbersome as, for instance, this could lead to class loading issues. A Canary release, where a new version is only released to a few users to validate the new service, is another example where multiple versions of the services have to coexist.

With microservices, both these scenarios are easily manageable. Since each microservice uses independent environments, including the service listeners such as embedded Tomcat or Jetty, multiple versions can be released and gracefully transitioned without many issues. Consumers, when looking up services, look for specific versions of services. For example, in a canary release, a new user interface is released to user A. When user A sends a request to the microservice, it looks up the canary release version, whereas all other users will continue to look up the last production version.

Care needs to be taken at database level to ensure that the database design is always backward compatible to avoid breaking changes.

As shown in the following diagram, version V01 and V02 of the Customer service can coexist as they are not interfering with each other, given their respective deployment environment:

Routing rules can be set at the gateway to divert traffic to specific instances, as shown in the diagram. Alternatively, clients can request specific versions as a part of the request itself. In the diagram, the gateway selects the version based on the region from which the request originated.

主站蜘蛛池模板: 思茅市| 屯留县| 通榆县| 长子县| 五大连池市| 南澳县| 梓潼县| 开封县| 芦山县| 新巴尔虎左旗| 雅江县| 余干县| 呈贡县| 习水县| 凤冈县| 光泽县| 安达市| 英吉沙县| 偃师市| 长沙市| 双流县| 万源市| 芜湖县| 彭泽县| 澄迈县| 宜宾县| 九寨沟县| 长葛市| 台南县| 濉溪县| 扬州市| 林周县| 海宁市| 华池县| 庆云县| 马关县| 淮阳县| 祁阳县| 梨树县| 宜宾县| 砚山县|