Updated on July 17, 2019Copy the code

preface

So far, springCloud has initially reached a certain market in China. Of course, news came out in 2018 that the supporting technologies of springCloud, Hystrix and Eureka, have stopped updating. The reason is that the existing technologies have been enough to support the current development needs, so they will not continue to update. Perform maintenance only.

This really hurts me a little bit, feeling that SpringCloud has not learned well enough, too many components are not well understood, and all of a sudden several key components are not updated.

However, although Hystrix and Eureka have stopped updating, and although springCloud is affected, you can switch to Consul, ZooKeeper, Etcd and other open source middleware because it is springCloud itself that is involved. It doesn’t really care what component it uses, it’s in the hands of the user.

Therefore, although Spring Cloud has undergone dramatic changes, we should not abandon it, because it is a new representative of the pure Spring family, which represents the seamless integration of all the development tools and traditions in the Spring camp.

Next, let’s start learning about springCloud.

The summary of springcloud

Spring Cloud is a complete set of microservice solutions based on the Spring Boot framework. To be precise, it is not a framework, but a large container, which integrates the best microservice frameworks on the market, thus simplifying the amount of code for developers.

It leverages the development convenience of Spring Boot to simplify the development of distributed systems such as service discovery, service gateway, service routing, link tracing, and so on. Spring Cloud does not duplicate the wheel, but integrates and encapsulates well-developed modules in the market, thus reducing the development cost of each module.

The current state of SpringCloud

At the beginning, springCloud’s market share in China was not high, of course, it is not very high up to now. When springCloud emerged, Dubbo also stopped updating, so springCloud had a place. But the year before last, Dubbo resumed updating. In addition, four maintenance releases were released in three months, and springCloud was soon followed by NetFlix’s Eureka and Hystrix, which made the current situation worse, and many small manufacturers jumped into Dubbo’s embrace.

Dubbo can also be used with springCloud, because Dubbo is focused on service governance and will continue to move in that direction. Spring Cloud focuses on the ecosystem of microservice governance. Because every aspect of microservice governance is its concern, service governance is only one part of the microservice ecosystem. Therefore, it is safe to assume that Dubbo will excel in service governance in the future, while Spring Cloud is unrivalled in the microservice ecosystem.

Of course, this is only the imagination of some people on the Internet. In reality, it is still rare to use Both springCloud and Dubbo in the market. A large number of entrepreneurs from Alibaba choose to directly use Dubbo.

Advantages and disadvantages of SpringCloud

When I saw a blog post on the Internet, I felt that it introduced the advantages and disadvantages of springCloud very carefully, so I will not make a summary and directly reprint it.

Original text: blog.csdn.net/valada/arti…

Main advantages:

1. As a summation, Spring Cloud includes all aspects of microservices architecture. 2. Convention over configuration, based on annotations, no configuration file. 3. Lightweight Components. The components that Spring Cloud integrates are mostly lightweight and are the best in their field. 4. Development is simple. Spring Cloud has a large number of packages for each component, thus simplifying development. 5. Flexible development. Spring Cloud components are decoupled, giving developers the flexibility to choose components on demand.Copy the code

Main disadvantages:

1. Project structure is complex, each component or each service needs to create a project. 2. The deployment threshold is high. The project deployment requires cluster deployment with Docker and other container technologies, and the learning cost is high for in-depth understanding of Docker.Copy the code

The relationship between SpringCloud and springMVC, springBoot, and Spring

Many friends, when learning springCloud, are thinking about the relationship between srpingCloud, springMVC and SpringBoot in the spring family.

Let’s summarize the definitions of these four first.

What is Spring?

A lightweight Inversion of Control (IoC) and AOP oriented container,Java development framework.

What is springMVC?

Is a Servlet based MVC framework mainly to solve the problems of WEB development.

SpringMVC is equivalent to what we call Spring +MVC. What is MVC? C (Controller controller) separates V (View, user client) from M (Model module, business).

Common MVC development frameworks in the industry include Struts1, Struts2 and so on. Spring as a professional open source framework for web project development, springMvc as an internal module, also adopt MVC design pattern.

What is Springboot?

In the Spring family, because Spring is getting better and better, and then when it comes to developing projects, there are more and more things that need to be configured. Sometimes, the development of the actual business takes less time than the configuration. At this time, SpringBoot comes into being.

Springboot encapsulates things that previously required manual configuration by developers, provides default configuration, reduces the number of XML configuration files, and provides a good encapsulation and integration of third-party technologies, providing a large number of third-party interfaces.

The core idea of Spring Boot is convention over configuration, and this is also the core idea of Spring Cloud.

What is springCloud?

Spring Cloud provides an effective solution toolbox for the application of distributed systems to rapidly build industry uniform characteristic patterns, such as configuration management, service discovery, fuses, intelligent routing, microservice proxy, control bus, one-time token, global lock, leadership election, distributed session and cluster state, etc. Through the implementation and coordinated use of distributed micro-service components, developers can quickly build well-running services.

SpringCloud is a mature, reliable, simple and easy to maintain micro-service distributed development scheme based on Springboot development. (Split business, microservice integration)

Since SpringCloud is a distributed service governance framework, it does not provide specific functional operations itself, but focuses more on communication, circuit breakers, monitoring, etc. Therefore, many components are required to support a single set of functions, which is equivalent to managing single microservices for multiple springBoot frameworks.

Of course, the purpose of the above content is to let everyone know more about the connection between the four, so there is no detailed introduction of the four. It’s certainly more complicated than that.

The main components and processes of SpringCloud

Let me show you a picture from @Wanglu-Louise

Service Discovery -- Netflix Eureka Customer service load Balancing -- Netflix Ribbon Circuit Breaker -- Netflix Hystrix Service Gateway -- Netflix Zuul Distributed Configuration -- Spring Cloud ConfigCopy the code

Main process:

After receiving the request, the gateway obtains the available service from the Registry (Eureka). The Ribbon loads the request and distributes it to the backend (5) Feign processes communications; (6) Hystrix processes service time-out fuse; (6) Turbine monitors call and mature indicators between servicesCopy the code

summary

That’s it for today, and tomorrow we’ll continue with springCloud.