Service discovery overview
In the previous chapter, 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
As you can see, the movie service calls both the metadata and rating service for fetching the complete movie details.
But how would our services send requests? How would they know the addresses of each other?
In our example, we used pre-programmed static values for the API handlers. The settings we used were as follows:
- Metadata service:
localhost:8081
- Rating service:
localhost:8082
- Movie service:
localhost:8083
In our approach, each service would need to know the exact address of the other services it would communicate with. This approach would work until we more than one instance of each microservice. In this case, we would have multiple challenges:
- What address should you...