A Service Registry is a database of the locations of service instances. The service instances are registered with the registry service upon startup and are de-registered automatically upon shutdown. Netflix provides a registry service server, which is Eureka. Spring Boot provides integration with the Netflix API, so we can easily implement a microservice registry using Netflix's Eureka server.
The client service, or external routers, makes a query to find the available instances of a service. The registry server provides all of the available instances of the requested service. Take a look at the following diagram, which shows Service Registry and discovery with Eureka:
As you can see, all services register with the Eureka server to make themselves available. In the following section, we'll look at how to register services...