tags: Microservice java distributed
I have been using java for learning and work for a while, and I have studied roughly some time agoDubboFramework, as the first time to use the microservice framework for me, in itsService governance、Service callI am deeply moved by the function, and I also feel itMicroservicewithMonolithic applicationI like the split of its functional modules, which reduces the coupling of the overall system. This may be what everyone saidLow coupling, high cohesionThink of it. The first time I came into contact, I couldn't wait to learn about it and master it, so I decided to go to the system to learn the springcloud system. In order to improve the learning effect and deepen the learning impression, I plan to write a series of notes blog during the learning process to assist my learning and share my process, hoping to help some novices who are the same, and also hope to read The big guys who came to my article can point out my shortcomings, thank you very much (▽)!
Although I just started to write study notes, I actually study onlinespringcloudThe related knowledge of has been around for a while, but this is a rough understanding of the relatively shallow knowledge, and a rough understanding of the components of this framework and the upgrading of those components, because in the previous versionspringcloudThe components have many components alsoStop and advanceNow, for a newbie like me, I need to understand its past and its present, because many components are connected, and the ideas and concepts are in the same line. Here I am also learning. Learn more about his attitude.
springcloudIt has been developing for a long time. With its rapid development, the composition of springcloud has also undergone great changes. Based on the information on the Internet, I have sorted out the old and new versions with 2020 as the dividing line.springcloudComposition of

We can see that the old version of the springcloud framework is mainly composed ofEureka、RIbbon、Feign、Hystrix、SpringCloud Config、SpringBootcomposition. The main modules are divided intoService registration and discovery、Service load and call、Service fusing and degradation、Service gateway、Service distributed configuration、Service development, You can see that the coverage is relatively comprehensive.

After the rapid development of springcloud, springcloud components are also blooming. Each module has many replaceable components, and technology selection can be made according to actual business needs.
Springcloud is a very good microservice framework. To manage many services, it is necessary to govern these services, which is what we are talking aboutService governance,Service governanceThe role of is to manage the dependency between each service and each service in the traditional rpc remote invocation framework, which can realize service invocation, load balancing, service fault tolerance, and service registration and discovery.
If there are call dependencies between microservices, you need to get the service address of the target service, which is the microservice governanceService discovery. To complete service discovery, it is necessary to store service information in a carrier, and the carrier itself is the microservice governanceService Registry, And the action of storing to the carrier isService registration。
The registration centers supported by springcloud areEureka、Zookeeper、Consul、Nacos
| Component name | Company | Introduction to Components |
|---|---|---|
| Eureka | Netflix | The earliest registration center of springcloud, has enteredStop and advanceUp |
| Zookeeper | Apache | zookeeper is a distributed coordination tool that can realize the registry function |
| Consul | Hashicorp | Consul simplifies the registration and discovery process of services in a distributed environment, discovering through HTTP or DNS interfaces. Support external SaaS providers, etc. |
| Nacos | Alibaba | Nacos is committed to helping you discover, configure, and manage microservices. Nacos provides a set of simple and easy-to-use feature sets to help you quickly realize dynamic service discovery, service configuration, service metadata and traffic management. |
Load balancing is built on the original network structure. It provides a transparent and cheap and effective way to expand the bandwidth of servers and network equipment, strengthen network data processing capabilities, increase throughput, and improve network availability and flexibility.
Currently springcloud supports two load balancing components:Ribbon、LoadBalance
| Component name | Company | Introduction to Components |
|---|---|---|
| Ribbon | Netflix | Ribbon is a client load balancing tool based on HTTP and TCP |
| LoadBalancer | - | - |
Microservices splits the traditional monolithic application into multiple microservices, and also considers how the services call each other. The old version of springcloud usesFeignTo support rpc calls, now Feign has stopped improving its dimensions, byOpenFeignService call
| Component name | Company | Introduction to Components |
|---|---|---|
| Feign | - | - |
| OpenFeign | SpringCloud | It is a declarative webService client, you can use it by defining the interface and adding annotations |
For the current high-concurrency scenarios common on the Internet, although we can provide a cluster method to tolerate service requests, it is inevitable that we will encounter unforeseen failures, such as downtime, as a complete microservice framework. Say, springcloud considers these situations and can chooseHystrix、seilience4j、sentinelTo protect the service and provideService degradation、Service fusing、Service current limitFunction of
| Component name | Company | Introduction to Components |
|---|---|---|
| Hystrix | Netflix | Delay and fault tolerance solutions for distributed systems have beenStop and advance |
| Resilience4j | - | Resilience4jIt is a lightweight, easy-to-use fault-tolerant library, inspired byNetflix Hystrix, But designed for Java8 and functional programming, it is officially recommendedHystrixAlternative. |
| Sentinel | Alibaba | Alibaba's flow control component for distributed service architecture |
In the process of governance of numerous services in microservices, the role of service gateway can be provided in the framework of microservicesUnified entrance、Authentication check、Dynamic routing、Reduce couplingFunction of
| Component name | Company | Introduction to Components |
|---|---|---|
| zuul | Netflix | Stop and advance |
| zuul2 | Netflix | 3 zuul core developers resigned, the gods fought, the way out is unknown |
| gateway | springcloud | A set of non-blocking network asynchronous gateways developed by springcloud |
Spring Cloud officially provides the Spring Cloud Config distributed configuration center, which provides centralized external configuration support. It is divided into two parts: client and server. The server is called the configuration center, which is an independent microservice application that is used to connect to warehouses (such as Git, Svn). The client does not provide an interface for obtaining configuration; while the client is each microservice application, and the configuration center address is specified Obtain the configuration content from the remote, and load the configuration information into the application context at startup. Because the configuration center implemented by Spring Cloud Config uses Git to store configuration information by default, version control management is also supported based on the characteristics of the Git repository itself. Currently springcloud is availablespringcloud configwithNacos
| Component name | Company | Introduction to Components |
|---|---|---|
| Config | springcloud | Config provides server-side and client-side support for externalized configuration in distributed systems. |
| Nacos | Alibaba | An easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications. |
Spring Cloud Bus connects distributed nodes with a lightweight message broker. It can be used to broadcast configuration file changes or communication between services, and can also be used for monitoring. This article is about using Spring Cloud Bus to realize the change of the configuration file of the notification microservice architecture.
| Component name | Company | Introduction to Components |
|---|---|---|
| Bus | springcloud | - |
| Nacos | Alibaba | - |
Spring Cloud is a set of microservice specifications designed based on Spring Boot and enhanced application context. Spring Cloud Alibaba uses Ali middleware as the foundation to implement Spring Cloud's microservice specifications.
2018-12-12 Netflix announced to stop the development of Spring Cloud related services: Ribbon, Feign, Eureka, Hystrix, continue to use it at your own risk
This article is based on my current understanding of springcloud. There must be many bad points and errors in the article. Please correct me if you see it.
Implementation of static proxy Earlier we completed the construction of the static proxy test environment, and now we start to implement the static proxy In order to realize the idea of Java layered...
The python language can do a lot of interesting things, the most typical of which is to do web crawlers. If you want to start a little project, let me study it with me. In addition, I am a sophomore. ...
I am a middle school student and I am a high school student. Since I was a child, I liked to study computer classes. I used to learn C++ before, but it didn't last long. The boring C++ made me give up...
Written in the forefront At the beginning, I did Android when I graduated. I didn't go to Android 5.0 at the time. I didn't have Material Design. At that time, the design was based on stereoscopic 3D ...
First, the characteristics of the graphical interface application Second, the operating mode Third, large software product architecture model Fourth, GUI development principles Fifth, th...
Preamble: That after a summer of 2017 graduate, he started early life of their graduate students. Bid farewell to the era of knowledge behind the book a few years, came into contact with the C # progr...
I used to learn Linux commands in a non-systematic way, and I usually used Baidu or something. After using it, I almost forgot it in a few days. Learned and learned, the familiar instructions will alw...
Study Notes-System Architecture of SSM Preface There are common three-tier architectures and MVC, no matter which language has this kind of thing. Both structures reduce the coupling between system mo...
Kinect fusion can realize the real-time reconstruction of indoor scenes, which is related to my research direction, so I start directly from the kinect fusion program example to learn c++ programming ...
0. Preface NumPy official websitehttp://www.numpy.org/ NumPy source code:https://github.com/numpy/numpy SciPy official website:https://www.scipy.org/ SciPy source code:https://github.com/scipy/scipy M...