Load balancing with Ribbon

In the last section, we saw how inventory-service can call catalog-service to fetch book details through Feign. However, in a distributed environment, it is quite possible that multiple instances of microservices are created to handle the enormous application load.

In a multi-instance environment, a mechanism is required to balance and divide a load of input requests seamlessly to send them to available instances. The system becomes fault tolerant. It also increases throughput, reduces response time, and optimizes resource utilization by avoiding single instances being overloaded. This will make the system more reliable and highly available.

Netflix provides a component called Ribbon, which works as a client-side load balancer that provides lots of flexibility and control while making HTTP and TCP calls. The term client-side refers to an individual microservice as Ribbon can be used to balance the flow of calls a microservice makes to other services. 

Eureka can be easily integrated with Ribbon; however, we can configure Ribbon without Eureka. We will see how to configure Ribbon with and without Eureka. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.121.242