Service discovery

The service registry has details of the services available and acts as the database. But in order to find out where the required service is and which services to connect, we need to have service discovery. So, service discovery is the end-to-end process and the service registry is the data store used by that process. They both work hand in hand.

When the pricing service wants to communicate with the demand service, it needs to know the network location of the demand service. In the case of traditional architecture, this is a fixed physical address, but in the microservices world, this is a dynamic address that is assigned and updated dynamically.

The pricing service (client) will have to locate the demand service in the service registry and determine the location and then load balance the request of the available demand service. The demand service, in turn, will respond to the request of the requested client (pricing service).

Service discovery is used to discover the exact service to which the client should connect to, in order to get the necessary details. 

Service discovery helps the API gateway to discover the right endpoint for a request.

They will also have a load balancer, which regulates the traffic and ensures the high availability of the services.

Based on the location where load balancing happens, the service discovery is classified into:

  • A client-side discovery pattern
  • A server-side discovery pattern
..................Content has been hidden....................

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