Skip to content

Service Discovery — Notes#

Functional#

  • Register / deregister service instances.
  • Health-checked endpoints.
  • Lookup by service name (DNS or API).
  • Watch for changes (push update on roster change).
  • Tags / metadata for routing decisions.

Non-functional#

  • Sub-second propagation typical.
  • Registry HA + survives partition.
  • Lookups must be fast (cached client-side).

Capacity#

  • Tens of thousands of services × instances.
  • High read fan-out from clients.

Models#

  • Client-side: clients query registry, load balance themselves.
  • Server-side: gateway / LB consults registry; clients hit VIP.
  • DNS-based: SRV records; simple but slow change propagation.
  • xDS (Envoy): explicit subscribe + push.

Trade-offs#

  • CP vs AP registry: Consul (CP) vs Eureka (AP) — depends on whether stale routing is acceptable.
  • Heartbeat-based TTLs vs active health checks: combine for safety.
  • Sidecar mesh simplifies app code but adds operational layer.

Refs#

  • Consul, etcd, Eureka, ZooKeeper docs.
  • "Service Discovery in a Microservices Architecture" Chris Richardson.
  • Envoy xDS protocol spec.