Skip to content
QuizMaker logoQuizMaker
Activity
System Design: The Complete Guide
1. System Design Basics
1. Introduction to System Design
2. Vertical vs Horizontal Scaling
3. Load Balancing
4. Caching Strategies
5. CDNs (Content Delivery Networks)
6. SQL vs NoSQL
7. Database Sharding & Partitioning
8. The CAP Theorem
9. Microservices Architecture
10. Message Queues & Event Streaming
12. Design BookMyShow (Ticket Booking)
14. Design Dropbox (Cloud File Storage)
15. How to Approach Any System Design Interview
16. Back-of-the-Envelope Estimation
17. Consistent Hashing
18. Bloom Filters & Probabilistic Data Structures
19. Database Replication
20. Leader Election & Consensus (Raft & Paxos)
21. Distributed Transactions (Saga, 2PC, Outbox)
22. Event Sourcing & CQRS
23. Unique ID Generation at Scale
24. Rate Limiting Algorithms
25. Circuit Breakers & Bulkhead Pattern
26. API Gateway, Proxies & Service Mesh
27. Real-Time Communication
28. Observability (Tracing, Logging, SLOs)
30. Design a Chat System (WhatsApp)
31. Design YouTube (Video Streaming)
32. Design a Web Crawler

3. Load Balancing

Distributing traffic evenly across your server fleet.

Feb 22, 202623 views0 likes0 fires
18px

Traffic Cops of the Internet

When you pursue Horizontal Scaling, you need a way to distribute incoming traffic across your fleet of servers. A Load Balancer (LB) sits between your users and your servers, acting as the single entry point. Users connect to www.example.com (the LB''s IP), and the LB transparently routes their packets to healthy backend machines.

Real-World Example: GitHub

GitHub receives billions of Git operations per day . Behind github.com , an HAProxy load balancer distributes requests across hundreds of backend servers. When GitHub''s engineering team deploys new code, they use the load balancer to gradually shift traffic from old servers to new ones—if the new code has a bug, only 1% of users are affected, and the rollback is instant. This pattern is called a canary deployment .

L4 vs L7 Load Balancing

Layer 4 (Transport Layer)

L4 load balancers route based on IP addresses and TCP/UDP ports. They''re fast because they don''t inspect the HTTP payload—they just forward raw packets. Think of them as a highway toll booth that routes cars to different lanes without checking what''s inside.

• Example: AWS Network Load Balancer (NLB) handles millions of requests per second with single-digit millisecond latency.

Layer 7 (Application Layer)

L7 load balancers understand HTTP and can route based on URL paths, headers, cookies, and even request bodies. This is far more powerful but adds processing overhead.

• Example: NGINX can route /api/* requests to your backend servers and /static/* requests to a CDN origin—all from a single entry point. Shopify uses this pattern to separate their storefront traffic from admin dashboard traffic.

Routing Algorithms

How does the Load Balancer decide which server receives the next request?

  1. Round Robin

The simplest approach: rotate through…

QuizMaker

Preview this lesson for free

Sign in to continue reading the full post.

Log in required
This lesson is available for logged-in users only.
No spam. Continue where you left off after signing in.

Share this article

Share on TwitterShare on LinkedInShare on FacebookShare on WhatsAppShare on Email

Test your knowledge

Take a quick quiz based on this chapter.

mediumSystem Design
Quiz: Load Balancers
5 questions5 min

Continue Learning

4. Caching Strategies

Intermediate
4 min

5. CDNs (Content Delivery Networks)

Beginner
10 min

6. SQL vs NoSQL

Intermediate
16 min
Lesson 3 of 5 in 1. System Design Basics
Previous in 1. System Design Basics
2. Vertical vs Horizontal Scaling
Next in 1. System Design Basics
4. Caching Strategies
← Back to System Design: The Complete Guide
Back to System Design: The Complete GuideAll Categories