liveBook · Manning

Application-level service discovery

As explained in Microservices Patterns, Second Edition

Application-level service discovery is service discovery implemented by application services and clients interacting with a dedicated service registry.

When service instances have changing network locations, application-level service discovery lets services and clients use a dedicated registry instead of hardcoded addresses. Each instance registers its location; a client queries the registry for available instances, then sends a request to one. section 8.2.5

The interaction has two responsibilities:

  • Service instances register their network locations and may provide a health-check URL. section 8.2.5
  • Clients query the registry and send requests to one of the listed instances. section 8.2.5

Dedicated registries such as Eureka, Consul, and ZooKeeper were used for this approach. Modern deployment platforms such as Kubernetes largely automate discovery, so most teams no longer need to implement it in applications. section 8.2.5

Figure 8.10 The service registry keeps track of the service instances. Clients query the service registry to find network locations of available service instances.
ApplicationLevelServiceDiscovery

Shows the registry tracking service instances and clients querying it for their network locations. section 8.2.5

How Microservices Patterns, Second Edition covers it

How deep it goes
Traces instance registration and client lookup, including an optional health-check URL.
Examples
Uses a service instance registering its location and a client querying the registry before sending a request.
What you can do after
Apply the pattern by registering instances and having clients query the registry before sending requests.
How it connects
Connects self-registration and service registries with platform-provided service discovery.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microservices Patterns, Second Edition. The section links point to the parts of the book it draws on.