Service discovery overview
In Chapter 2, Scaffolding a Go Microservice, we created an application consisting of three microservices. The relationship between the services is illustrated in the following diagram:

Figure 3.1 – Relationship between our microservices
To make requests to each service, we used static addresses that we set in our code. The settings we used were as follows:
- Metadata service:
localhost:8081
- Rating service:
localhost:8082
- Movie service:
localhost:8083
This approach with pre-programmed service addresses has some significant limitations:
- Impact on scalability: Each time you need to add or remove instances, you need to update the code of each calling service
- Reliability issues: If an instance becomes unavailable for an extended period (for example, due to network failure), your services will keep calling it until you update their configuration
How do we address these limitations?
...