Summary
In this chapter, we did an overview of service discovery and compared its different models. You have learned what the service registry is and what its main service discovery models are. We have illustrated how to use a client-side service discovery model by providing two implementations, one using an in-memory set of data and another using Hashicorp Consul. We have also plugged the Consul-based implementation into our microservices to demonstrate how to use it in the microservice logic. Now, you know how to add and use service discovery in your applications.
In the next chapter, we are going to discuss another important topic: serialization. You will learn how to encode and decode the data transferred between the services. This will help us move to further topics, covering the communication between the services we will cover in Chapter 5.