Spring Cloud for microservice solutions

(1) Basic introduction to Spring Cloud

Spring Cloud is a project released by Pivotal in 2015. Many people may not know Pivotal. Spring is developed by Pivotal.

The mainstream microservice solutions in the industry mainly include:
Spring Cloud Netflix
Spring Cloud Alibaba

To put it simply, Spring Cloud provides some tools that allow developers to quickly build microservice applications, such as configuration management service discovery, fusing, intelligent routing, etc. These services can work well in any distributed environment. Spring Cloud is mainly committed to solving the following problems:

Distributed/versioned configuration 分布式及版化配置
Service registration and discovery  服务注册与发现
Routing  服务路由
Service-to-service calls  服务调用
Load balancing  负载均衡
Circuit Breakers  断路器
Global locks 全局锁
Leadership election and cluster state   Leader选举及集群状态
Distributed messageing 分布式消息

It should be noted that Spring Cloud is not a new framework developed by the Spring team. It just integrates some of the more excellent open source frameworks that solve common problems in the microservice architecture based on the Spring Cloud specification, and re-packages them through the Spring Boot framework. The complex configuration is shielded to provide developers with a good out-of-the-box microservice development experience. It is not difficult to see that Spring Cloud is actually a set of specifications, and Spring Cloud Netflix, Spring Cloud Consul, and Spring Cloud Alibaba are the implementations of Spring Cloud specifications.

(2) Introduction to Spring Cloud version

Spring Cloud is a set of specifications that integrates the open source technologies of major companies, and the release of these open source technologies is maintained by each company, and each sub-project maintains its own release version number, so it is not like in the traditional sense Version naming, instead of using the name of the London Underground station to define a major version according to the alphabetical order combined with the chronological order of the corresponding version, the release order of the previous versions of
Insert picture description here
Spring Cloud is as follows: Each major version of Spring Cloud passes BOM (Bill of Materials) to manage the version list of each sub-project. The following figure shows the version list of each sub-project provided by the Spring Cloud official website. The header (Edgware.SR6, Greenwich.SR2) indicates the major version number of Spring Cloud. The content in the table is the version number of all sub-projects corresponding to the current major version number. To put it simply, if we introduce the version of Spring Cloud to Edgware.SR6, then the version number of the dependent Spring-Cloud-Aws is 1.2.4.RELEASE, and the version number of Spring-Cloud-Bus is 1.3.4.RELEASE. Careful readers will find that there is an SR6/.SR2 after the Spring Cloud major version number. After the release of the Spring Cloud project has accumulated to a critical point or solved some serious bugs, a Service Release version, referred to as SRX, will be released. X is an increasing number.

Insert picture description here

It is worth noting that all subprojects in Spring Cloud rely on the Spring Boot framework, so there is also a dependency and compatibility relationship between the version number of the Spring Boot framework and the version number of Spring Cloud. As shown in Figure 2-2, it is the version dependency officially provided by Spring Cloud. Edgware and Dalston can be built on Spring Boot 1.5.x, but they are not compatible with Spring Boot 2.0.x. And, starting from the Finchley version, the Spring Boot version must be above 2.0.x, and Spring Boot 1.5.X is not supported

Insert picture description here

(3) Implementation of Spring Cloud Netflix under the Spring Cloud specification

There are two main solutions for service governance under the Spring Cloud ecosystem: Spring Cloud Netflix and Spring Cloud Alibaba. These two solutions are the integration of Netflix OSS and Alibaba's service governance system based on the Spring Cloud specification. The book is mainly based on the Spring Cloud Alibaba ecology for detailed explanations.

Spring Cloud Netflix mainly provides solutions for service governance under the microservice architecture, including the following components:

Insert picture description here
Note: The following components Netflix announced to enter maintenance mode, no major feature upgrades
Insert picture description here

(4) Implementation of Spring Cloud Alibaba under the Spring Cloud specification

(1) Technical framework

Spring Cloud Alibaba is the implementation of open source components and cloud products under the Alibaba Group under the Spring Cloud specification. On October 31, 2018, Spring Cloud Alibaba officially entered the Spring Cloud official incubator and released the first preview version.

Spring Cloud Alibaba mainly provides one-stop solutions for microservice development, allowing developers to easily solve various technical problems under the microservice architecture through the Spring Cloud programming model. The following are the main functional components under the Spring Cloud Alibaba ecosystem. These components include open source components and Alibaba Cloud product components. Cloud products need to be paid for.

Insert picture description here

(2) Advantage analysis

1. Alibaba's open source components have been widely used in major companies before being woven into the Spring Cloud ecosystem, so integration into the Spring Cloud ecosystem allows developers to easily implement technology integration and migration

2. Alibaba's open source components have natural advantages in service governance and the ability to handle high concurrency. After all, these components have undergone several double 11 tests and have been applied on a large scale by major Internet companies. Therefore, compared to Spring Cloud Netflix, Spring Cloud Alibaba’s ability in service governance is more suitable for domestic technical scenarios. At the same time, Spring Cloud Alibaba not only fully covers the native features of Spring Cloud Netflix, but also provides more Stable and mature implementation, I am very optimistic about the future development of SpringCloud Alibaba.

(3) Version of Spring Cloud Alibaba

Spring Cloud Alibaba released the first preview version on October 31, 2018, 0.2.0.RELEASE and 0.1.0.RELEASE, of which 0.1.0.RELEASE is compatible with Spring Boot 1.5.x, and 0.2.0.RELEASE is compatible with Spring Boot 1.5.x. Spring Boot 2.0.x is compatible. Since Spring Cloud is based
in Spring Boot framework for integration, and Spring Boot 1 and Spring Boot 2 there is a big change in terms of class and some configuration notes, etc., so over a period of time if you do upgrade, or will be considered compatible with the old version.

At present, Spring Cloud Alibaba has released two graduation versions. The latest version corresponds to the version relationship of each sub-project as shown in the figure.
Insert picture description here

Insert picture description here

Guess you like

Origin blog.csdn.net/Octopus21/article/details/113789615