Part 2 of 10 · 1 min read
One server, one request
The simplest system, and the path of a single request through it.
Think of a food stall. One person takes orders, cooks, packs and takes payment. That works for a few customers an hour.
A first version of a system works the same way. Everything runs on one computer: the web application, the database and any cache.
Server
A server is a computer, or a program on one, that answers requests from other programs. Here, one server runs everything.
Example: a laptop in a closet running a website, its database and its files.
The path of a request:
- A user types a domain name, such as
shop.example.com. - The browser asks the Domain Name System (DNS), a phone book for the internet, which address belongs to that name. DNS is usually a paid service run by another company, not by the site.
- DNS answers with an IP address, such as
15.125.23.214, the real address of the computer. - The browser sends an HTTP request (the standard way browsers ask for pages) to that address.
- The server sends back a page or data. Phone apps usually get data in JSON, a simple text format.
GET /users/12 <- "give me user number 12"
{"id": 12, "name": "Asha"} <- the answer, in JSON
Two kinds of traffic arrive: web pages in a browser, and phone apps. Both use the same HTTP, and both can use the same server.
IP address
An IP address is the number that identifies a computer on a network, so that other computers can send data to it.
Example: 15.125.23.214.
Read it as
DNS turns a name people can remember into a number computers use. Without it, users would type numbers.
Check yourself:
- Which part of the path turns
shop.example.cominto a number? - What kind of data does a phone app usually receive?