The Spring Cloud Ribbon is an HTTP and TCP-based client load Balancing tool that is based on the Netflix ribbon. Through the package of spring cloud, Allows us to easily convert service-oriented Res template requests automatically into client load-balanced service calls. Although the Spring cloud ribbon is just a tool-class framework, it does not need to be deployed as a service registry, configuration center, API Gateway, but it almost exists in every spring cloud-built microservices and infrastructure. Because of the calls between MicroServices, the API Gateway's request forwarding, and so on, is actually achieved through the ribbon, including the subsequent feign we will learn, it is also based on the Ribbon implementation of the tool.
One, client load balancing
Load balancing is one of the most important means to the high availability of the system, the mitigation of network pressure and the capacity expansion of processing. We often say that load balancing refers to server-side load balancing, which is divided into hardware load balancing and software load balancing. Hardware load balancing is mainly through the server node to install the device specifically for load balancing, such as F5, and software load balancing is to complete the request distribution work by installing some software with load balancing function or module on the server, such as Nginx, etc. Whether you are using hardware load balancing or software load balancing, server-side load balancing can be built in a similar way as architecture.
Hardware load balancing devices or software load balancing software modules will maintain a bottom-up available service-side inventory, through heartbeat detection to eliminate the failed service-side node to ensure that the list is a normal access to the server node, when the client sends the request Load Balancer device, the device according to an algorithm (eg: Linear polling, load by weight, load by traffic, etc.) remove the address of a server from the list of available services that is maintained, and then forward it.
"Springcloud Micro-Service Learning series" Client load balancer Spring Cloud Ribbon