We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design Masterclass · Load Balancing Proxies
Free preview: the first part of this 15-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Load Balancing Proxies
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
Here is a web address. I want us to take it apart slowly, the way the person who sorts mail at the front desk of a big office reads an envelope.
https://shop.example.com/api/v2/orders/42?expand=items#total
Think about that person for a moment. By the time a letter reaches the front desk, the country, the city and the street have already done their job. They brought the letter to this building. So the person at the desk ignores all of that and reads one more line: the name of the team inside. That one line decides which mail slot the letter goes into. Every letter gets the same treatment: skip the lines that got it here, read the line that says where it goes inside.
A web address has lines too. Let me read them one at a time.

The standard for web addresses, RFC 3986, names these five parts. The host, the path and the query travel inside the request. The scheme decides how the connection is made. The fragment after the # never leaves your browser.
Here are the five parts in plain words:
https. How to talk. Here it is the secure version of , the language browsers and web servers speak.shop.example.com. Mostly this is the host, also called the host name: the name of the machine. It can also carry a port number, which is like a door number on that machine. When you leave it out, the browser uses the usual door for , which is 443./api/v2/orders/42. Which thing on that machine you want.?expand=items. Extra options for that thing.#total. A bookmark inside the page. The standard says the fragment is cut off before the request is made, so the server never sees it.When your browser sends the request, it does not send the address as one line. It sends something like this:
GET /api/v2/orders/42?expand=items HTTP/1.1
Host: shop.example.com
The first line is called the request line. GET means "please fetch this for me", and after it come the path and the query. The second line is a header: an extra labelled line sent with the request. Here the label is Host and the value is the host name. So when the request is sent, the parts are already separated, and a program can read the path without even looking at the host.

The person at the desk does not care which city the letter came through. There is one job: read the last line and put the letter in the right slot for the team inside.
Now the question for this whole lesson. Suppose one company runs many different programs behind shop.example.com. One program draws the web pages. Another answers questions about orders. Another hands out pictures and script files. The scheme and the host got the request to the company's front door. Which part of the address should decide which program answers?
It is easy and good
“It is really nice and good Please join the course”