Quiz
Warm-up from unit 6: a program's variables live in RAM while it runs. What happens to them when the program ends or the power goes off?
Two computers talking
So far everything ran on one machine. The internet is what happens when programs on different machines send each other data.
The pattern behind nearly all of it is client and server:
- A client is the program that asks: your browser, your phone apps
- A server is a program (running on a computer that is usually in a data center, a warehouse-sized building full of computers run around the clock exactly for this) that answers: it waits, receives requests, and sends back responses
When you visit a website, your browser sends a request across the internet, something like "GET the page at hackuniversity.dev". The server receives it, runs code to build or fetch the page, and sends back a response containing the page data. Your browser then draws it.
It is lesson 1-1's triangle stretched across the planet: the request is the server's input, its code is the process, and the response is its output. A server is just a program, and people write servers in Python every day.
Quiz
You open a weather app and today's forecast appears. Which statement fits the client-server model?
Problem
In the client-server model, what is the general name for the program that waits for requests and sends back responses?