Service discovery

The client of a service, whether it is an API gateway or another service, needs the ability to discover the location of a service instance. In a traditional distributed environment, service locations (IP address and port) are generally static, and a service instance can be found easily. For example, service locations could be read from a configuration file.

However, service discovery is more complex with a cloud-based application using microservices. The number and location of service instances changes dynamically in the cloud. A service registry can be used to keep track of service instances and their locations.