How it works · 35 of 49 Foundation

What is client-server architecture?

What lives on the phone, what lives on the server

Client–server: Client–server splits an app across the network: the client (a phone app, a browser) shows things and asks; the server holds the shared records and makes every decision that others must trust. Anything on the client can be read and changed by whoever holds the phone, so the phone may check for speed but only the server decides.

Loading the animation…

Say it like this Client–server splits an app across the network: the phone shows and asks, the server holds the shared records and makes every decision others must trust, because anything on the phone can be read and changed by whoever holds it.

Under the hood — for builders
Worked example: the ₹1 shirt
On the card, the phone shows ₹799 and a user changes it to ₹1 before paying. A server that charges the price the phone sends sells the shirt for ₹1; one that looks the price up in its own list charges ₹799. Checking the form on the phone is fine, for speed; deciding there is not.
The source, in its words
Fielding, 2000 (the thesis that defined REST): "A server component, offering a set of services, listens for requests upon those services." "A client component, desiring that a service be performed, sends a request to the server via a connector." "Separation of concerns is the principle behind the client-server constraints."
Terms
Client: the program that asks (a browser, an app). Server: the program that waits for requests and answers them. Request and response: one question and its answer over HTTP; MDN: "the browser sends an HTTP Request to the server". Round trip: the time for that question and answer. Thin client: shows and asks; thick client: also works things out itself.
The rule, from OWASP ASVS 4.0.3
1.5.3: "Verify that input validation is enforced on a trusted service layer." 1.4.1: "Never enforce access controls on the client." Trusted means "any trusted enforcement point, regardless of location": a server, a serverless API, a microservice. The phone may repeat the check for speed; it never replaces it.
The price of a thick client
Work moved onto the phone arrives as JavaScript the phone must download and run. The median web page keeps sending more of it.
Run here: two stock counts or one?
50 shirts, 200 buyers in 10 minutes, 4 phones each selling from its own stock copy and syncing with the others now and then, against one count on a server. Rates are ours.
Measure it
Round trips per task and their time on a slow phone network · KB of script per screen · orders the server rejected after the phone said yes · what still works offline.
Watch out
A copy on the phone is for reading; anything that spends money, stock or trust is decided again on the server. Too thin a client makes every tap wait a round trip; too thick, and the phone downloads the whole shop. Offline orders need an id so a resend is not a second order.
Sources
Roy T. Fielding, "Architectural Styles and the Design of Network-based Software Architectures", 2000, §3.4.1 · OWASP ASVS 4.0.3, V1 (1.4.1, 1.5.3) · MDN, "Client-Server overview" · HTTP Archive Web Almanac 2024, "JavaScript" · all read in session · oversell simulation, Python, 21 Nov 2026.

What happens in the Client–server animation, step by step?

  1. Put the whole shop on every phone and each keeps its own stock count. Two phones sell the last shirt twice.
  2. Client–server tears the app in two. The shared records float up to one server; the phone keeps the screen and asks.
  3. Your turn: slide how much lives on the phone. Watch speed, offline use and cheating change.
  4. The rule: the phone may check, for speed; only the server decides. Change the price to ₹1 on the phone and the server still charges ₹799.
  5. In a tunnel the phone browses its copy and holds the order until the server says yes. Every phone still needs that one server: what if there were none? Next: peer-to-peer.

What everyday example explains Client–server?

A restaurant: diners read the menu and order at the table; the kitchen holds the stock and decides what can be served. A diner who crosses out a price on the menu still pays the till's price.

Why should a team care about Client–server?

Every app decides what to trust the phone with. Put too little there and each tap waits a round trip; put too much and users can fake prices, copies disagree, and the phone downloads the shop.