Design: Load Balancing System
Design focuses on the load balancer components and their differences at Layer 4 and Layer 7. Out of scope are backend server implementations and client-side details.
Functional Requirements
FR1: Distribute incoming client requests efficiently across multiple backend servers
FR2: Support both Layer 4 (Transport Layer) and Layer 7 (Application Layer) load balancing
FR3: Ensure high availability and fault tolerance
FR4: Provide low latency request routing
FR5: Support health checks for backend servers
FR6: Allow session persistence (sticky sessions) when needed
Non-Functional Requirements
NFR1: Handle up to 50,000 concurrent connections
NFR2: API response latency p99 under 100ms
NFR3: Availability target of 99.9% uptime
NFR4: Support both TCP and HTTP/HTTPS protocols
NFR5: Scalable to add more backend servers without downtime