---
title: 'Load Balancers Explained: The Basics'
source: 'https://youtube.com/watch?v=LQuuoHTyYz8'
video_id: 'LQuuoHTyYz8'
date: 2026-09-03
duration_sec: 404
channel: 'ByteByteGo'
---

# Load Balancers Explained: The Basics

> Source: [Load Balancers Explained: The Basics](https://youtube.com/watch?v=LQuuoHTyYz8)

## Summary

This video provides a comprehensive introduction to load balancers, explaining their role as traffic directors for scalable and reliable applications. It covers the core benefits of load balancing, the different types of load balancers (hardware, software, cloud-based, Layer 4, Layer 7, and global server load balancers), and the various algorithms used to distribute traffic. The video also highlights the key metrics load balancers provide for monitoring system health and performance.

### Key Points

- **Load Balancer Definition** [00:00] — A load balancer acts as a traffic director for incoming requests, distributing network or application traffic across multiple servers to prevent any single server from becoming overwhelmed.
- **Benefits of Load Balancing** [00:41] — Load balancing distributes workload to prevent bottlenecks, enables dynamic scaling, reduces latency, and enhances availability through redundancy and failover.
- **Types of Load Balancers** [01:23] — Load balancers can be categorized as hardware (dedicated appliances), software (running on commodity hardware), or cloud-based (managed services). They can also be classified by network layer: Layer 4 (transport layer) and Layer 7 (application layer).
- **Layer 4 vs Layer 7** [02:17] — Layer 4 load balancers make routing decisions based on IP addresses, ports, and TCP/UDP connections, making them faster and more efficient. Layer 7 load balancers inspect content (HTTP headers, URLs, cookies) for content-based routing and can perform SSL termination.
- **Global Server Load Balancers (GSLBs)** [03:30] — GSLBs distribute traffic across multiple geographic locations, considering user proximity and backend health. They use DNS-based routing or anycast networking for low latency and regional failover.
- **Load Balancing Algorithms** [04:20] — Common algorithms include round-robin (sequential distribution), sticky round-robin (client-to-server binding via session ID), weighted round-robin (proportional distribution based on server capacity), IP/URL hashing (consistent routing based on hash), least connections (to server with fewest active connections), and least time (to fastest server).
- **Load Balancer Metrics** [05:55] — Key metrics include traffic metrics (request rates, total connections), performance metrics (response time, latency, throughput), health metrics (server health checks, failure rates), and error metrics (HTTP error rates, dropped connections).

### Conclusion

Load balancers are essential for building scalable, reliable, and high-performance applications. Understanding the different types, algorithms, and metrics is crucial for effectively managing traffic and ensuring system health.

## Transcript

Load balancers, a fundamental piece of infrastructure that underpins scalable and reliable applications. Whether we're building web applications, APIs, or complex distributed systems,
understanding how load balancers function is important. Let's dive into the basics together. At its core, a load balancer acts as a traffic director for an application's incoming requests. It's a hardware device or a software component that distributes network or application traffic
across multiple servers to ensure that no single server becomes overwhelmed. Distrofic distribution isn't just about avoiding overloads. It's about laying the groundwork for a more robust and efficient system.
First, load balancing helps us distribute workload, preventing any single server from becoming a bottleneck and ensuring consistent performance. Second, load balancers enable us to scale applications dynamically.
We can add or remove resources as demand shifts. This ensures that our app remains responsive and stable during peaks and valleys of daily traffic. By intelligently distributing requests, low-balances reduce latencies and improve response times.
Also, distributing requests across multiple servers enhances availability by providing redundancy and failover options. This means our application remains accessible even if some servers experience issues.
Now, let's consider the types of load balancers we will encounter. We can categorize them in a few ways. Hardware load balancers are dedicated physical appliances known for their robust performance and stability designed for high enterprise environments in dedicated data centers Software load balancers run on commodity hardware offering greater flexibility and cost
making them suitable for a wider range of applications. Cloud-based load balancers are managed services offered by cloud providers. This approach reduces operational overhead by shifting the management burden to the cloud
provider. Load balancers can also be classified by the network layer in which they operate. Layer 4 load balancers operate at the transport layer. They primarily make routing decisions based on IP addresses, ports, and TCP or UDP connections.
Because they don't inspect the content of the traffic, Layer 4 load balancers are faster and more efficient. They are good for basic load balancing tasks where content-based routing isn't required. Use Layer 4 for speed and simplicity.
It's ideal for TCP traffic and basic load balancing needs. Layer 7 load bonuses operate at the application layer, specifically with HTTP and HTTPS. This enables routing decisions based on the content of the traffic, such as HTTP headers, URLs, cookies, and other application-specific data.
This makes Layer 7 ideal for complex applications that require content-based routing, such as directing users to different servers based on the requested URLs. Layer 7 load balancers can perform SSL termination at the load balancer itself, improving performance
by offloading encryption and decryption from back-end servers, and centralizing SSL certificate management and security policies Use Layer 7 when you need content routing or advanced features like SSL termination It gives you more control but requires more processing power Finally there are global
server load balancers. These operate at a higher level, enabling traffic distribution across multiple geographic locations. This is useful for applications with a global user base that require
low latency access and increased resilience. GSLBs consider factors like user proximity to data centers and the overall health of back-end infrastructure across the globe.
They can use DNS-based routing or any cast networking to direct users to the nearest available data center and provide failover across regions to ensure high availability.
GSLBs aren't just for large corporations. They are essential for any application that needs to provide consistent service and performance to users worldwide. How do load balancers actually distribute traffic?
It depends on the chosen algorithm, and selecting the right one can significantly impact efficiency. Round-robin is the simplest method. It sequentially distributes requests across available servers, rotating through them in
a loop. Sticky round-robin types are client-to-specific server by creating a session ID, usually via a cookie or using a client's IP address. Once this sticky session is created, all requests from the client go to the same server, helpful
for applications that rely on server-side session data, though they can make scaling more complex. Weighted round involves assigning weights to each server allowing a load balancer to send a proportionally higher number of requests to more capable servers and fewer requests to those with limited resources
This increases overall system performance and utilization. IP URL hashing takes a different approach to consistent routing than sticky sessions. Instead of tracking session state, it uses a hash function that will always route the
same IP or URL to the same server. This saleless approach is particularly useful for catching static content. These connections direct traffic to the server with the fewest active connections at any given time, ensuring a more even relationship with the load.
A similar algorithm leads time, routes requests to the fastest or most responsive server, ensuring a more responsive user experience and reduced latency. Load balancers provide vital metrics for monitoring system health and performance.
Traffic metrics provide insight into traffic volumes through request rates and total connections. Performance metrics such as response time, latency, and throughput help us evaluate user experience.
Health metrics, including server health checks and their failure rates, alert us to backend server issues. Finally, error metrics like HTTP error rates and drop connections help us identify potential connectivity problems.
Together, these metrics give us a comprehensive view of a system's health and availability. If you like our video, you may like our system design newsletter as well. It covers topics and trends in large-scale system design,
trusted by 1 million readers.
