Implementing service discovery
In the traditional monolithic architecture, if an application has multiple services then often these services are running on fixed and well-known locations (such as a URL or ports). This understanding of "well-known" is coupled into the code logic to make inter-service calls. A consumer service will call another service either at the code level or use hardcoded remote calls over the network.
By contrast, often microservices are running in virtualized or containerized environments and IP ports are assigned dynamically. To facilitate inter-service calls, we implement service discovery. In the service discovery pattern, all the microservices will register their running instances with service discovery, and clients (that is, upstream clients or even another service) will then sync up with service discovery to get the network location of the required service. Furthermore, service discovery will maintain a continuous health check on all the registered...