Microservice pattern: Client-side service discovery

Author: iluwatarCreated Oct 15, 2023Updated Aug 16, 2026
Labelsinfo: help wantedepic: patterntype: feature

Description: The Client-Side Service Discovery pattern is a design strategy in microservice architectures where the client is responsible for determining the network location of service instances. This involves querying a service registry, which keeps track of available service instances. The client retrieves the required information and selects an appropriate service instance to communicate with.

Main elements of the pattern include:

  • Service Registry: A centralized database that maintains the addresses of service instances.
  • Service Registration: Services register their network locations (IP addresses and port numbers) with the service registry.
  • Service Querying: Clients query the service registry to get the location of a service instance.
  • Load Balancing: Clients implement load balancing strategies to choose among multiple service instances.

References:

  1. Microservices Patterns
  2. Spring Cloud Netflix Eureka
  3. Project Contribution Guidelines

Acceptance Criteria:

  1. Implement a service registry that can register and deregister service instances.
  2. Create a client module that can query the service registry to discover service instances.
  3. Ensure that the client module includes a basic load-balancing mechanism to distribute requests among multiple service instances.

Source: iluwatar/java-design-patterns