Service Discovery
Last updated
Was this helpful?
Last updated
Was this helpful?
It is not ideal to hard code the ip address directly so as to make a api call to another microservice, as the address may be changed, but also the a microservice can be deployed in multiple server instance
In order to get the location of other service, we need service discovery , eureka is one of the example of doing this
There are 2 types of service discovery : client side or server side
Client Side : microservice make a request to the service to get back the address and then make a call to the other microservice based on the address that returned, e.g: eukera
Server Side: microservice make call to the service, and service help you to redirect to corresponding microservice and not need to return address, e.g: nginx, aws
To register each microservices into eukera so that eukera server know the ip address and port of each microservices
To discover other microservice and provide the relevant information such as ip ,port , so as to facilitate the communication between microservices