Client-side service discovery

With the client-side service discovery method, the individual services need to be aware of the service registry. For example, in this model, if Service Instance A wants to make a request to Service Instance C, then the process of making this request will be as shown in the following diagram:

The flow of the request is explained as follows:

  • Service Instance A queries the service registry for the network address of Service Instance C.
  • The Service Registry checks its database for the network address of Service Instance C and returns it to Service Instance A. In case Service Instance C is a load balanced service with more than one network location, the Service Registry is supposed to run an appropriate load balancing algorithm to return the correct network address of Service Instance C.
  • Once Service Instance A receives this network address, it makes the request to Service Instance C.

This is a straightforward process of service discovery, but has the drawback that now the service discovery logic needs to be added to all the services in the infrastructure, making the services more complicated.

To tackle these kinds of issues, there is another pattern of service discovery that means that the service discovery logic doesn't have to be replicated inside every other service. Let's take a look at this pattern of service discovery.

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

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