Design loadbalancer | System Design Interview | Uber | Microsoft
In system design, a load balancer is a foundational infrastructure component that enables horizontal scalability, high availability, fault tolerance, and low latency in large-scale distributed systems. It acts as an intermediary between clients and a pool of backend services, distributing incoming traffic in a controlled and efficient manner to prevent overload on any single server. From a system design perspective, the primary responsibility of a load balancer is traffic distribution. Incoming requests are routed to backend instances using well-defined load balancing algorithms such as round-robin, weighted round-robin, least connections, or consistent hashing. In large-scale system design, consistent hashing is especially important because it minimizes request remapping during scaling events, which improves cache efficiency and system stability. Load balancers are commonly classified based on the OSI layer at which they operate. A Layer 4 (L4) load balancer functions at the transport layer and routes traffic based on IP address and port information. L4 load balancers are optimized for high throughput and low latency, making them suitable for performance-critical system design scenarios. A Layer 7 (L7) load balancer, on the other hand, operates at the application layer and makes routing decisions based on HTTP headers, URLs, cookies, or hostnames. In modern microservices-based system design, L7 load balancers enable content-based routing, API gateway patterns, and service-to-service communication.
Download
0 formatsNo download links available.