Service registry

Microservices are independent, but many use cases will need them to be interdependent. This means that for some services to work properly, they need data from another service, which, in turn, may or may not depend on other services or sources.

For example, our pricing service will directly depend on the demand service, which, in turn, depends on the inventory service. But these three services are completely independent, that is, they can be deployed on any host, port, or location and scaled at will.

If the pricing service wants to communicate with the demand service, it has to know the exact location to which it can send requests to get the required information. Similarly, the demand service should know about the inventory service's details in order to communicate. We will not know the details of the location beforehand as the services can be scaled independently.

So we need a service registry that registers all the services and their locations and configuration. All services should register themselves with this registry service when the service is started and deregister themselves when the service goes down.

The service registry should act as a database of services, recording all the available instances and their details.
..................Content has been hidden....................

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