Lesson 2 of 18
3. Client and Server

3.1 What exactly are a client and a server?

3 min read+10 XP

The conversation

In the restaurant: The customer asks and the kitchen answers. It isn't about who's bigger or more important. It's about who starts the conversation and who does the work.

In the system:

  • A client is any program that sends a request: your browser, a mobile app, or even another server calling an API.
  • A server is a program that waits for requests and answers them. It usually runs on a machine in a data centre, listening on a port (443 for HTTPS, 80 for plain HTTP).

The words describe roles, not machines. The bookstore's app server is a server to your phone, but a client when it asks the database for book 42. One program can be both, at different moments.

Why split it like this? The kitchen holds the ingredients and the recipes (the data and the business rules), so they stay in one trusted place. Millions of customers can order without each needing their own kitchen.

Memory code: "Customers ask, kitchens cook." Client = whoever asks. Server = whoever answers. Roles, not machines.