Skip to content

Web & Internet

Client vs Server

The idea, in plain English

The client is the customer. The server is the kitchen. The client (a browser, a phone app, or another program) sends requests asking for things. The server is a computer that's always running and listening. It does the actual work and sends results back. The client never does the work itself. It always asks the server and waits for the answer.

How it works

  1. 1The client puts together a request that describes what it wants.
  2. 2The client sends the request and waits for a response.
  3. 3The server is always running and listening. It receives the request and does the actual work.
  4. 4The server sends its result back as a response. The client then uses it, for example by showing a page or updating the screen.

When you'd use it

This happens anytime an app needs data or work done somewhere else. Examples: loading a webpage, checking your email, or a mobile app fetching your latest notifications.

Common beginner mistakes

  • Don't assume 'server' always means a giant machine in a data center. It can be a laptop, a phone, or a small program. The point is that it waits for and answers requests.
  • Don't forget that the client starts the exchange. Over plain HTTP (HyperText Transfer Protocol), the server can't just decide to send you something out of nowhere.

Try it — edit and run

Click the code to edit · press ⌘/Ctrl+↵ to run

Editable code. Tab and Shift+Tab indent. Press Escape, then Tab, to move focus out of the editor.

Expected output — hit Run to try it
Client sends: order 42
Server received: order 42
Client receives: order #42 is ready

Not sure this is the right topic? See the learning paths → or where this leads →