Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Load Balancers  ›  Lesson

Load Balancer vs Reverse Proxy

LB vs Reverse Proxy 12 minA reverse proxy is a server that stands in front of back-end servers and handles requests on their behalf; a load balancer is a reverse proxy whose main job is spreading requests across several of them.

Load Balancer vs Reverse Proxy

Hop's server has been doing everything itself: handling HTTPS, compressing responses, answering every browser directly. Soon there will be five servers. Both changes point to the same idea — put something in front — and two names get used for it, often loosely. Here is the difference.

The rule

A reverse proxy stands in front; a load balancer also chooses who serves.

A reverse proxy is a server that receives requests from clients and forwards them to back-end servers, then passes the answers back. Clients only ever see the proxy. That position is useful even with one back end:

  • TLS termination — handle HTTPS certificates and encryption in one place.
  • Compression and caching — shrink responses and answer repeat requests without bothering the back end.
  • Hiding and protecting — the back end's address stays private; limits and filters sit at the door.
  • One front, many back ends — send /api/ to one service and / to another.

A load balancer spreads requests across several back-end servers that do the same job. It picks a server for each request, stops sending to servers that fail health checks, and lets you add or remove servers without clients noticing.

So a load balancer is a reverse proxy with one main job: distributing. Many products (for example NGINX, HAProxy, Envoy and cloud load balancers) can do both.

browsers ──▶ [front door] ──▶ Hop server 1
                         ├──▶ Hop server 2
                         └──▶ Hop server 3

The shortcut

Count the servers behind the door. One → you need a reverse proxy, if anything. Two or more doing the same job → you need load balancing.

Hop's front door growsStep 1 of 4
  1. One server

    A reverse proxy handles HTTPS and compression, and hides the server's address. Nothing to balance yet.

The trap is fixing the servers' single point of failure by creating a new one at the door.

Drills

Answer fast — trust the rule.

quick drill

Hop has exactly one application server. Which of these still makes sense?

quick drill

What does a load balancer do that a plain reverse proxy may not?

quick drill

What happens when one of the servers behind a load balancer fails its health checks?

quick drill

After adding a load balancer, what is the new single point of failure if there is only one?

Remember

  • A reverse proxy stands in front; a load balancer also chooses who serves.
  • Shortcut: one server → reverse proxy; two or more doing the same job → load balancing.
  • Trap: a single front door becomes the new single point of failure.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainDoes Hop need a proxy or a balancer?

Hop still runs on one application server, but wants HTTPS handled in one place, compressed responses and the server's real address hidden. Later it will run five servers. Explain what a reverse proxy is, why it helps Hop even with one server, and what changes when the five servers arrive.