SpringCloud 2020 study notes-preface

tags: Microservice  java  distributed

SpringCloud 2020 study notes-preface

I. Introduction

​ 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 governanceService 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 ()!

2. System composition

​ 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

2.1 Early composition

springCloud

We can see that the old version of the springcloud framework is mainly composed ofEurekaRIbbonFeignHystrixSpringCloud ConfigSpringBootcomposition. The main modules are divided intoService registration and discoveryService load and callService fusing and degradationService gatewayService distributed configurationService development, You can see that the coverage is relatively comprehensive.

2.2 The latest composition

2020

​ 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.

3. Registration Center

​ 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 areEurekaZookeeperConsulNacos

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.

Fourth, load balancing

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:RibbonLoadBalance

Component name Company Introduction to Components
Ribbon Netflix Ribbon is a client load balancing tool based on HTTP and TCP
LoadBalancer - -

Five, service call

​ 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

6. Service protection

​ 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 chooseHystrixseilience4jsentinelTo protect the service and provideService degradationService fusingService 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

Seven, service gateway

​ In the process of governance of numerous services in microservices, the role of service gateway can be provided in the framework of microservicesUnified entranceAuthentication checkDynamic routingReduce 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

Eight, service configuration

​ 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.

Nine, service bus

​ 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 -

Ten, springcloud and springcloud 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.

Intelligent Recommendation

SSH preface study notes (3)

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...

Python crawler study notes one-----opening preface

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. ...

Feng Wei's JAVA study notes - Preface

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...

Preface to "Material Design Getting Started Study Notes"

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 ...

QT study notes (a) - Preface: GUI program development

First, the characteristics of the graphical interface application Second, the operating mode     Third, large software product architecture model Fourth, GUI development principles Fifth, th...

More Recommendation

[Unity] introductory study notes 180514-- preface / Book

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...

Shell script programming study notes (preface)

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

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...

Preface to kinect fusion and c++ study notes

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 ...

NumPy study notes 00. Preface and installation

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...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top