Service Discovery Client/Server Side
- Anand Nerurkar
- Feb 14
- 2 min read
đ What is Service Discovery?
In microservices, services need to find and call each other.
But:
IP addresses change
Containers restart
Pods scale up/down
So instead of hardcoding IPs, we use service discovery.
There are two main types:
Client-side discovery
Server-side discovery
đ§ 1ď¸âŁ Client-Side Discovery
đ How It Works
The client asks a service registry:
âWhere is Service B?â
The registry returns a list of available instances.
The client:
Chooses one instance (load balancing)
Calls it directly
So the client is responsible for:
Looking up
Load balancing
Retry logic
đ Flow
Client â Service Registry â Gets instance list â Calls Service directly
đ Example
Common tools:
Netflix Eureka
Consul
Spring Cloud
In Kubernetes:
Internal DNS-based service discovery
đŚ Banking Example
Retail Service needs Customer Service.
Steps:
Retail queries Eureka
Gets 3 instances of Customer Service
Retail picks one
Direct REST call
â When to Use Client-Side Discovery
â You control all clientsâ Microservices are built in same tech stackâ You want fine-grained client controlâ Internal-only architecture
Most internal microservice architectures use this.
đ 2ď¸âŁ Server-Side Discovery
đ How It Works
The client does NOT query registry.
Instead:
Client calls a load balancer
Load balancer queries registry
Load balancer forwards request
So discovery happens at infrastructure layer.
đ Flow
Client â Load Balancer â Registry â Target Service
đ Example
Amazon Web Services ELB
Microsoft Azure Application Gateway
NGINX
Kubernetes Service
đŚ Banking Example
Mobile App â API Gateway â Internal Services
The mobile app doesnât know anything about service instances.
API Gateway:
Routes
Load balances
Performs discovery
â When to Use Server-Side Discovery
â External clients (mobile/web)â Polyglot clients (multiple tech stacks)â You want centralized routingâ You want better security controlâ Large enterprise environments
Most banks use server-side discovery for external traffic.
âď¸ Key Differences
Feature | Client-Side | Server-Side |
Who does discovery? | Client | Load balancer |
Load balancing | Client | Infrastructure |
Complexity in client | Higher | Lower |
Best for | Internal services | External traffic |
Control | Distributed | Centralized |
đ§ Enterprise Architect Perspective
In a bank:
Internal microservices â Client-side discovery
External/mobile traffic â Server-side discovery via API Gateway
This gives:
Flexibility internally
Control and security externally
đ¤
You can say:
âClient-side discovery delegates service lookup and load balancing to the client, making it suitable for internal microservices. Server-side discovery centralizes this responsibility in a load balancer or gateway, making it ideal for external-facing or polyglot environments where centralized control and security are important.â
.png)

Comments