Skip to main content

Command Palette

Search for a command to run...

βš–οΈ Load Balancing Explained Like You're 5

Published
β€’2 min read
S

Building AI systems and writing about how they actually work. Master of AI @ University of Technology Sydney. Previously B.Tech CS with focus on IoT. I believe the best way to learn is to explain. That's why I'm documenting tech concepts with simple analogies (@sreekarreddy.com). AWS Certified β€’ Azure AI Certified β€’ Neo4j Professional β€’ Google Data Analytics When not coding: exploring Sydney, working on side projects, and teaching tech to anyone who'll listen.

Multiple checkout lanes at a store

Day 30 of 149

πŸ‘‰ Full deep-dive with code examples


The Bank Teller Analogy

Multiple tellers at a bank:

  • One teller β†’ Long line, slow service
  • Five tellers β†’ Shorter lines, faster service
  • Manager directs customers to available tellers

A Load Balancer directs traffic to available servers!


The Problem It Solves

One server has limits:

  • Can handle a limited number of requests
  • If it goes down, users may get delays or errors
  • Gets slow as traffic grows

How It Works

Traffic goes through the load balancer:

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
Users ─────────────▢│  Load Balancer  β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β–Ό                β–Ό                β–Ό
       Server 1         Server 2         Server 3

The load balancer decides which server handles each request.


Distribution Methods

Round Robin:

  • Request 1 β†’ Server 1
  • Request 2 β†’ Server 2
  • Request 3 β†’ Server 3
  • Repeat!

Least Connections:

  • Send to server with fewest active requests
  • Better when some requests take longer

Geographic:

  • US users β†’ US servers
  • European users β†’ EU servers

Benefits

  • Handle more traffic β†’ Multiple servers share load
  • High availability β†’ One server down? Others still work
  • Scalability β†’ Add more servers as needed
  • Better performance β†’ Users hit less-busy servers

In One Sentence

Load Balancing distributes incoming traffic across multiple servers so no single server gets overwhelmed and your app stays fast and available.


πŸ”— Enjoying these? Follow for daily ELI5 explanations!

Making complex tech concepts simple, one day at a time.

More from this blog

esreekarreddy

132 posts