HLDintermediate

Service Discovery

Service discovery helps dynamic services find each other without hardcoded addresses. It is essential in containerized and microservice environments where instances come and go frequently.

Reading time

9 min

service discoverydnsregistrymicroservices

Why Discovery Exists

In modern infrastructure, service instances are replaced often. Their IP addresses are not stable, so clients need a reliable way to discover where a service currently lives.

Approaches

  • Registry-based discovery
  • DNS-based discovery
  • Service mesh sidecars

Client-Side vs Server-Side Discovery

Client-side discovery puts lookup logic in the client. Server-side discovery hides that behind a gateway or load balancer.

Interview Tip

Mention service discovery together with health checks and load balancing.