What is Service Discovery?


The majority of the time, virtualized or containerized systems are used to run microservices-based applications. A service's locations and number of instances fluctuate constantly. To enable requests to reach the target microservice, we need to know the locations of these instances and their names. This is when Service Discovery comes into play.


By using a crucial component known as the Service Registry or Discovery Server, the Client or API Gateways can find the network information (IP address and port) of the Server using the Service Discovery design pattern.


The IP address and Port of each microservice in the design are tracked by the Service Registry and kept in its database. The discovery service receives a heartbeat whenever a service scales up or down, and it updates its database accordingly. Additionally, the instances of each service are grouped appropriately by the discovery server and Registry.