Phase 0
The client-server model and the request-response cycle
How a client asks for something, how a server answers, and why almost everything in backend engineering builds on this one exchange.

Client and server are roles, not machines
Nobody's job title is "client." It's a role in one specific exchange: whoever asks is the client, whoever answers is the server. Your browser is a client when it loads this page. But the backend serving this page is itself a client the moment it turns around and queries a database. Same request, different direction, different role.
This trips people up constantly when they're new. They picture "the backend" as one fixed thing that only ever serves. In practice almost nothing in a real system is purely one or the other - most services spend half their time answering requests and the other half making their own.
The cycle, stripped down
- A client sends a request. Here's what I want, here's whatever data goes with it.
- The server does the work - hits a database, runs some logic, maybe calls another service itself.
- The server sends a response back. Success, or here's what went wrong.
- That's it. Unless something's built specifically to remember, the server has no memory of this exchange five seconds later.
Client Server
|--- GET /users/42 ------------->|
| | (looks up user 42)
|<---- 200 OK, { user data } ----|
Interactive example
One trip out, one trip back
The dot follows a single request from client to server and back again. Hover to send a second client through the same server.
The server answers the client, and to do that it becomes a client of the database itself - same ask-work-answer shape, one hop deeper. Nothing about the exchange is remembered once the response is sent, so the second client's request starts from scratch.
Every APIAPIA defined way for one piece of code to ask another to do something, without needing to know how it happens internally. Not a specific technology - a function signature, a library's exports, and a REST endpoint are all APIs. style you'll run into - REST, GraphQL, gRPC - is a variation on this same shape. So is your browser loading a plain webpage. The wrapper changes; the ask-work-answer rhythm underneath doesn't.
Why bother naming something this obvious
Because once you see it explicitly, debugging gets a lot less vague. "The API feels slow" stops being a feeling and becomes a question: is the delay in the network hop, in the server actually doing work, or in some downstream call the server is making that you haven't noticed yet? Those are three different problems with three different fixes, and you can't tell which one you have until you've split the cycle apart in your head.
Same with "will this scale." That's really asking whether the server side of the cycle keeps up as more clients show up on the other end at once - which is most of what caching, load balancing, and queues in later sections are actually solving.
One thing worth sitting with: a request that the client thinks failed might have actually succeeded on the server, with only the response lost on the way back. The client can't always tell the difference between "never happened" and "happened, but I never heard back." That gap is where a surprising number of production bugs live, and it's why idempotencyIdempotencyThe property of an operation where doing it multiple times has the same effect as doing it once - like pressing an elevator button repeatedly. Critical for safely retrying requests over an unreliable network. shows up so often later in this curriculum.
It's also why "API" and "client-server model" get used almost interchangeably in casual conversation, even though one is a specific interface and the other is the underlying shape it's built on. Every REST endpoint, every GraphQL query, every gRPC call is just this same request-response cycle wearing different clothes - which is worth remembering the next time a new API style shows up and looks unfamiliar at first glance.