Two ways your services find each other when IP addresses stop being stable — and why the "right" answer has quietly shifted over the last decade
By The Coding Gopher
Published: 2026-09-25
URL: https://thecodinggopher.substack.com/p/service-discovery-client-side-vs
In a monolith, this problem doesn’t exist. Everything runs in one process, and function calls don’t need to ask “where is the billing module right now?” The moment you split into services running on multiple hosts, that question becomes real — and it doesn’t have a fixed answer, because instances scale up, scale down, crash, and get rescheduled onto different machines constantly. A service’s IP address today tells you nothing about where it’ll be in five minutes.
Service discovery is the general mechanism for answering “where is this service right now, and is it healthy?” There are two fundamentally different places to put that logic: in the client making the call, or in a dedicated component sitting between the client and the service. Almost every discovery mechanism you’ll encounter is one of these two, or a variant built on top of them.
Service discovery is the automated process of detecting devices, network locations, or microservices within a distributed system. Instead of using hardcoded IP addresses or ports, applications query a central service registry to dynamically find and communicate with active, healthy service instances as they scale or change.
The shared piece: the service registry
Both approaches depend on a service registry — a database that tracks which instances of a service currently exist, their network locations, and their health status. Instances register themselves (or get registered by an orchestrator) on startup, send heartbeats or get health-checked periodically, and get removed when they stop responding.
A service registry is a central database that tracks network locations and details for software services. It lets programs find and talk to each other without using hard-coded IP addresses or ports. This tool is key for modern cloud apps that change size or move often.
Common registries: Consul, etcd, Apache ZooKeeper, and — in Kubernetes environments — the built-in service registry backed by etcd. The registry itself isn’t the differentiator; what differs is who queries it and decides where to route a request.
Join a community of senior engineers. Subscribe and get FREE access to System Design deep dives.
Client-side discovery
In this model, the calling service queries the registry directly, gets back a list of healthy instances, and picks one itself — usually via a load-balancing algorithm running in-process (round robin, least connections, weighted random).
┌──────────┐ 1. "who has Service B?" ┌──────────┐
│ Service A│ ─────────────────────────────────► │ Registry │
│ (client) │ ◄───────────────────────────────── │ │
└────┬─────┘ 2. list of healthy instances └──────────┘
│
│ 3. client picks an instance and
│ calls it directly
▼
┌──────────┐
│ Service B│
│ instance │
└──────────┘
Characteristics:
-
The client owns the load-balancing decision — it can be as smart or as simple as you want (latency-aware routing, zone-aware routing, custom retry logic)
-
No extra network hop: the client talks directly to the chosen instance
-
Every client needs a discovery library, in every language your services are written in — this is the classic pain point
-
If the registry format or discovery protocol changes, every client needs updating
In a client-side discovery pattern, the service consumer (client) directly queries a central Service Registry to find the network location of available service instances and handles local load balancing.
Where you’ll see it: this was the model popularized by Netflix’s early microservices stack — Eureka as the registry, Ribbon as the client-side load balancer. It made sense for Netflix because they were running one dominant language (Java) with a shared client library, which sidesteps the “every language needs its own client” problem.