One side asks, the other side answers: the oldest and most common shape of a networked app.
Client-server is the most basic way to build networked software. A client asks for something, and a server does the work and sends back an answer.
In the client-server model, the work is split in two roles. The server holds the shared things: the data, the rules and the secrets. The client shows the result to the user and collects what the user wants to do. The client sends a request, and the server sends back a response.
One server usually serves many clients at the same time. That is the whole point: instead of every phone keeping its own copy of all the data, there is one place that is kept correct and shared by everyone.
The roles are about who does what in one conversation, not about the type of machine. A web server can be a client when it calls a payment service. A laptop can be a server for a small test. It is common to have a chain: browser → web server → database server.
| Style | Where the work happens | Example | Good and bad |
|---|---|---|---|
| Thin client | Mostly on the server. The client only shows pages. | A classic website, a remote desktop | Easy to update and secure. Needs a connection for every action. |
| Thick (fat) client | A lot happens on the client, which keeps its own data. | A desktop game, an offline-first app | Fast and works offline. Harder to update and to keep in sync. |
| Rich web app (SPA) | The browser runs a lot of code and calls an API for data. | Gmail, Google Maps | Smooth feel. Big first download, and more client code to manage. |
| Style | How it works | Used for |
|---|---|---|
| Request / response | The client asks and waits for one answer | Web pages, REST APIs |
| Long polling / SSE / WebSocket | The connection stays open so the server can push news | Chat, live scores, notifications |
| Streaming | The server sends a long flow of data | Video, large downloads |
A simplified model. Each client sends one request every 5 seconds. Reply time grows as a server gets busy (about 20 ms / (1 − busy share)). Real systems also depend on the work each request does.
| Term | Meaning in easy words |
|---|---|
| Client | The program that starts a request (browser, app, or another service) |
| Server | The program that waits for requests and sends back responses |
| Request | A message from the client asking for data or an action |
| Response | The server's reply, with a status and often some data |
| Protocol | The agreed rules for the messages, such as HTTP |
| API | The list of things a client is allowed to ask the server to do |
| Stateless | The server does not remember a client between two requests |
| Tier | One layer of the system, such as client, app server or database |
| Thin client | A client that does very little itself and relies on the server |
| Round trip | One request going to the server and the response coming back |
| Port | A number that tells the machine which program should get the message |
| Choice | We gain | We lose |
|---|---|---|
| More work on the server | Control, security and easy updates | Server cost and more load per user |
| More work on the client | A fast, offline-friendly feel | Harder updates and less trust in the data |
| Stateless servers | Easy to copy and replace | State must live in a token or shared store |
| Chatty API (many small calls) | Simple, flexible endpoints | Many round trips, slower on weak networks |
| Big combined API calls | Fewer round trips | Larger replies and less flexibility |
| One server | Simple and cheap | No safety if it fails and a hard limit on load |