StackGrab

Chapter 1 of 4

Clients and servers

A system is a set of parts that work together to produce a result. A web app is a system, and so is a restaurant. In a restaurant, you are the : you ask for something. The kitchen is the : it does the work. The waiter is the network: it carries your order to the kitchen and brings the dish back. What you ask for is a ; what you receive is a .

Computers use the same pattern. Your browser is a client. It sends a request over a network to a server. The server does some work — perhaps it looks up a product or checks a password — and sends a response back. The client does not need to know how the kitchen is arranged, and the server does not need to know who is asking. They agree on the shape of the message, and that is enough.

This split is useful because each side can change on its own: you can upgrade the kitchen without buying new tables.

A blueprint-style restaurant: a customer at a table hands an order to a waiter, who carries it to a kitchen where a cook prepares a dish, then carries the dish back to the customer.
A restaurant is a system: you (client) order, the waiter carries it (network), the kitchen (server) cooks, the dish comes back (response).
Chapter 1: Clients and servers