Client-Server Model
The foundational architecture of the web: clients (browsers, apps) send requests and servers process them and return responses. Every web interaction follows this pattern.
What is Client-Server Model?
In short
The client-server model is a way of splitting a computer application into two roles: a client that asks for something and a server that holds the data or logic and answers. The client sends a request over a network, the server processes it and sends back a response, which is the pattern behind almost every website, mobile app, and API on the internet.
What the client-server model actually is
A client is any program that initiates a request: your web browser, a phone app, a command-line tool like curl, or even another server calling an API. A server is a program that waits for requests, does some work, and replies. The defining rule is that the client always speaks first and the server never starts the conversation on its own.
This split lets one server handle thousands of clients at once, and lets a client be a thin, simple program that does not need to store all the data or run all the heavy logic. The browser on your laptop does not contain Gmail's inbox; it just asks Google's servers for it and renders what comes back.
It contrasts with peer-to-peer, where every machine is both a client and a server and there is no central authority. BitTorrent and the original Skype were peer-to-peer. Almost everything else you use daily, from Amazon to your banking app, is client-server.
How a request and response actually travel
Say you open systemdesign.academy. Your browser (the client) first resolves the domain name to an IP address through DNS, then opens a TCP connection to that address on port 443 and runs a TLS handshake to encrypt the channel. Only then does it send an HTTP request like GET / with headers describing what it wants.
The server receives that request, often through a load balancer that picks one of many backend machines. The chosen server runs application code, maybe queries a database like PostgreSQL, builds an HTML or JSON response, and sends it back down the same connection with a status code such as 200 OK or 404 Not Found.
Each request is independent. Plain HTTP is stateless, meaning the server does not remember you between requests by default. To recognize a logged-in user, the server hands the client a session cookie or a token that the client attaches to every later request. That is how the model fakes continuity on top of one-off message exchanges.
When to use it and what it costs
The client-server model is the default for almost any system where data must be shared, secured, or kept consistent across many users. Centralizing data on a server means you control access, run backups, push updates in one place, and keep a single source of truth. That is why every SaaS product, online store, and multiplayer backend uses it.
The trade-offs are real. The server is a central point of failure: if it goes down, every client is stuck, which is why production systems run many server replicas behind a load balancer. The server is also a scaling bottleneck, since one machine can only handle so many simultaneous connections before you must add more capacity or shard the load.
There is also latency baked in. Every interaction is a network round trip, so a user in Sydney talking to a server in Virginia pays the speed-of-light cost on every request. Engineers fight this with CDNs, caching, and edge servers placed closer to users, but the underlying request-response shape never changes.
Where it is used in production
Gmail and Google Search
Your browser is a thin client that sends requests to Google's servers, which run the search or fetch your inbox and return the result.
Nginx
One of the most widely deployed web servers; it accepts client HTTP requests and either serves files directly or forwards them to application servers.
PostgreSQL
A database server that application servers act as clients to, sending SQL queries over a connection and receiving result sets back.
Amazon and online stores
The mobile app or website is the client; Amazon's backend servers handle catalog, cart, and checkout, keeping all real data server-side.
Frequently asked questions
- What is the difference between a client and a server?
- A client starts the conversation by sending a request and usually runs on a user's device. A server waits for requests, does the work or holds the data, and sends back a response. One server typically handles many clients at the same time.
- Is the client-server model the same as a three-tier architecture?
- Not quite. Three-tier is a common way to build the server side: a presentation tier, an application tier, and a data tier. Client-server is the broader idea of request and response between two roles. A three-tier app is still client-server from the browser's point of view.
- How is client-server different from peer-to-peer?
- In client-server there is a clear, central server that everyone talks to. In peer-to-peer every machine is both client and server and they talk directly to each other with no central authority. BitTorrent is peer-to-peer; almost every website is client-server.
- Can one program be both a client and a server?
- Yes, and it is common. An application server is a server to the browser but a client to the database. An API gateway answers user requests while making its own requests to downstream services. The role depends on which side of a given request the program is on.
- Why is HTTP called stateless in the client-server model?
- Because the server does not automatically remember anything about a client between requests. Each request must carry all the context it needs. To keep a user logged in, the server gives the client a cookie or token that the client resends on every later request.
Learn Client-Server Model hands-on
This page explains the idea. The full lesson lets you step through the ring as servers join and leave, read the implementation, and check yourself with a quiz. It is one of 760+ lessons in the System Design Masterclass, from your first API call to distributed consensus. Eleven Foundation lessons are free, no signup. Lifetime access is ₹499 in India or $7.99 worldwide, one payment, no subscription.
See also
Related glossary terms you might want to look up next.
HTTP
The protocol powering the web. A request-response model where clients ask for resources and servers respond. Stateless by design.
REST API
An architectural style for building APIs using standard HTTP methods (GET, POST, PUT, DELETE). Resources are identified by URLs.
API
Application Programming Interface: a contract defining how two pieces of software talk to each other. The waiter between your frontend and your backend.
Latency
The time delay between sending a request and getting a response. Amazon found every 100ms of extra latency costs 1% in sales.
Throughput
The number of operations a system can handle per unit of time. Think of it as how many cars a highway can move per hour.
Bandwidth
The maximum amount of data that can be transferred over a network in a given time. It's the width of the pipe, not how fast the water flows.