Load Balancing

Load balancing is the strategic distribution of network traffic across multiple servers or resources to optimize performance, enhance reliability, and ensure hi...

Load balancing is a fundamental technique in distributed systems and network architecture used to distribute incoming network traffic across multiple backend servers or resources. The primary goal is to optimize resource utilization, maximize throughput, minimize response time, and avoid overloading any single resource. Load balancers operate at various layers of the OSI model, with Layer 4 (Transport Layer) and Layer 7 (Application Layer) being the most common. Layer 4 load balancers typically make routing decisions based on IP addresses and port numbers, offering high performance and simplicity. Layer 7 load balancers, on the other hand, can inspect the content of the traffic (e.g., HTTP headers, URLs) to make more intelligent routing decisions, enabling features like SSL termination, content-based routing, and session persistence. Common algorithms include Round Robin, where requests are distributed sequentially; Least Connections, which directs traffic to the server with the fewest active connections; and IP Hash, which uses a hash of the client's IP address to ensure requests from the same client consistently go to the same server. Advanced techniques involve health checks to detect and remove unhealthy servers from the pool, ensuring high availability and fault tolerance. Trade-offs involve complexity, cost, and potential single points of failure if the load balancer itself is not redundant.

        graph LR
  Center["Load Balancing"]:::main
  Rel_advanced_propulsion_systems["advanced-propulsion-systems"]:::related -.-> Center
  click Rel_advanced_propulsion_systems "/terms/advanced-propulsion-systems"
  Rel_content_delivery_network["content-delivery-network"]:::related -.-> Center
  click Rel_content_delivery_network "/terms/content-delivery-network"
  Rel_distributed_systems["distributed-systems"]:::related -.-> Center
  click Rel_distributed_systems "/terms/distributed-systems"
  classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
  classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
  classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
  classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
  linkStyle default stroke:#4b5563,stroke-width:2px;

      

🧒 Explícalo como si tuviera 5 años

Imagina un restaurante popular con muchos camareros. Load balancing es como un anfitrión que dirige a los nuevos clientes al camarero que tiene menos mesas para servir, para que todos reciban su comida más rápido y ningún camarero se abrume.

🤓 Expert Deep Dive

El balanceo de carga es la distribución estratégica del tráfico de red entre múltiples servidores o recursos para optimizar el rendimiento, mejorar la fiabilidad y garantizar una alta disponibilidad, evitando así un único punto de fallo y gestionando la utilización de los recursos de manera eficaz.

📚 Fuentes