System Design Problem

Design a Service Discovery System

Commonly Asked By:HashiCorpNetflixAWSGoogle

  • Services register themselves on startup (name, address, port, health endpoint, metadata)
  • Services deregister on shutdown (graceful) or get auto-deregistered on failure
  • Clients look up healthy instances of a service by name
  • Health checking: periodic checks (HTTP, TCP, gRPC) to detect unhealthy instances
  • Support for multiple environments/namespaces (prod, staging, per-tenant)
  • Service metadata: version, region, weight, canary flags
  • Watch/subscribe: clients get notified of changes (new instances, removals)
  • DNS-based and API-based discovery
  • Load balancing integration: return instances in weighted/round-robin order

A Consul-like service discovery system with a Raft-consistent registry, health checking by local agents, gossip-based anti-entropy, and client-side caching with watch support for instant updates.

Loading...