Design: Service Discovery System for Microservices
Design the service discovery mechanism including registration, lookup, and health checking. Out of scope: detailed microservice business logic, security/authentication mechanisms.
Functional Requirements
FR1: Automatically register new microservice instances when they start
FR2: Allow microservices to find and communicate with other services dynamically
FR3: Support health checks to remove unhealthy service instances
FR4: Handle service instance failures gracefully
FR5: Provide low latency service lookup
FR6: Support scaling to thousands of service instances
Non-Functional Requirements
NFR1: System must handle 10,000+ service instances
NFR2: Service lookup latency p99 < 50ms
NFR3: Availability target 99.9% uptime
NFR4: Support dynamic scaling of services without manual intervention