Proxies

A middleman in between · Part of Networking and infrastructure

Key idea

Practice

7 questions · about 4 min

Explained step by step

Proxy

A proxy is a middleman: it receives clients' requests and passes them to servers, like a customs broker who does the paperwork for you. Along the way it can filter requests, log them or transform them: encrypt them, compress them or add data. It can be a program or a device. For example, a company with 500 employees can route all its traffic through 1 proxy.

Forward proxy

A forward proxy (or just proxy) sits in front of a group of clients. When those computers ask the internet for something, the proxy asks for them, so the site sees the proxy and not each client. It's like sending a friend to shop for you: the seller sees your friend, not you. It's used to block content, give anonymity and reach country-blocked content, though the proxy's owner can still see what you do.

Reverse proxy

A reverse proxy sits in front of one or more web servers and catches clients' requests before they reach them. It's like the front desk of an office building: visitors talk to reception, they never go straight up. That way clients never talk directly to the origin server. It's used for security, caching, SSL encryption and load balancing.

The difference between the 2 proxies is which side they're on. A forward proxy sits in front of clients and ensures no server talks directly to them. A reverse proxy sits in front of servers and ensures no client talks directly to them. It's like a representative: yours, who talks to companies for you (forward), or a company's, who deals with all its customers (reverse).

SSL termination

A typical job for a reverse proxy is SSL termination: it receives encrypted connections (HTTPS), decrypts them and passes the requests to the server in plain form. It's like an interpreter at a conference entrance: they translate once and inside everyone speaks the same language. Decrypting costs processor work, so doing it in 1 place spares the 10 servers behind it that work.

Load balancer

A reverse proxy and a load balancer look alike, but they're not the same. A load balancer makes sense when several servers do the same thing and work must be split. A reverse proxy is useful even with just 1 server, for security, caching or encryption. A reverse proxy can act as a load balancer, but not the other way around. It's like a doorman who also directs people to elevators: anyone directing people to elevators needs several elevators, but the doorman is useful even with one.

Single point of failure

Adding a reverse proxy adds complexity: one more piece to configure and look after. And if there's only one, it's a single point of failure: if it goes down, no client reaches the servers, even if they're perfectly fine. It's like a stadium's only gate: if it jams, nobody gets in. The fix is several reverse proxies with fail-over, which adds even more complexity.

Terms in this lesson

Arki, the beaver mascot

Your next interview starts with 5 minutes today.

Free on iOS and Android. Start from zero, no account needed.

Key idea

A middleman in between