advanced

Service discovery

Resolve dynamic service locations through platform DNS, registries, load balancers, or meshes without hard-coded endpoints.

Clients must find service instances without hard-coded IPs. Patterns include DNS (Kubernetes services), registries (Consul, Eureka), load balancers, and service mesh sidecars that resolve names to healthy endpoints.

Trade-off: dynamic discovery enables scaling and rolling deploys but adds cache staleness and misconfiguration risk.

On interviews: explain how a new pod receives traffic in Kubernetes; compare client-side versus server-side discovery.

Common pitfalls: stale registry entries; discovery without health awareness; debugging pain when names abstract too much.

Checklist:

  • Use platform-native discovery where possible.
  • Tie routing to health/readiness state.
  • Document service naming conventions.
  • Test behavior during rolling deploys.