Client-Server Model

The fundamental pattern that powers distributed systems, from web apps to cloud infrastructure.

OVERVIEW

The Concept

The client-server model allows multiple users to access shared data and services through a centralized system. Clients request data or actions, and the server processes those requests and returns results.

Without it, everything breaks

Without this model, every user must store and manage their own data locally. This leads to inconsistent data, no collaboration, and systems that cannot scale.

Real-world applications

  • Web applications (browser talking to servers)
  • Mobile apps communicating with backend APIs
  • Online games connecting to game servers
  • Banking systems processing transactions
Clients ask for things, and servers do the work and send results back.
ARCHITECTURE

Evolution & Frames

Frame 1: Naive System

Each user operates independently with their own data and logic. There is no communication or shared state between users.

Frame 2: Failure

Users attempt to share data manually, resulting in duplication, version conflicts, and lack of a single source of truth.

Frame 3: Introducing Client-Server

A central server is introduced. Clients send requests, and the server responds with processed data.

Frame 4: Improved Flow

Requests flow from client to server, the server processes them (optionally using a database), and sends back responses.

Frame 5: Trade-offs

The server can become overloaded or fail, making it a bottleneck and single point of failure.

TERMINOLOGY

Key Concepts

Interview talking points

  • Client initiates the request
  • Request-response cycle
  • Single source of truth
  • Stateless vs stateful server
  • Horizontal scaling
Client does not mean frontend, and server does not mean backend. These are roles. Any system can act as a client or a server depending on context.
DESIGN

Trade-offs

When to Use

  • Multiple users need shared data
  • Centralized control is required
  • System needs to scale horizontally

When Not to Use

  • Offline-first systems
  • Peer-to-peer systems
  • Ultra low-latency local processing

Key Trade-offs

  • Centralization simplifies management
  • Server can become a bottleneck under load
  • Single point of failure risk
  • Network latency introduces delays
  • Easier to update and maintain
APPLICATIONS

Where This Appears

URL Shortener

Clients request redirection, server maps short URLs to long ones and redirects.

Chat Application

Clients send messages, server routes them to recipients and stores message history.

Payment System

Clients initiate transactions, server validates and processes payments securely.

INTERACTIVE

Live Simulation

live system lab

Client–Server Flow Simulation

Explore how client requests travel to the server, how queues form, and how failures impact latency and success rates. Click clients or toggle failure modes to see the system react.

Clients5
Request ratemedium
Server capacity5 req/s
failure modes
network arena
Click a client or let the traffic flow
Server zone
serverOnlineQueue: 00% load
Request (client → server)
Response (server → client)
Error / dropped
0
requests sent
0
responses ok
0
errors
avg latency
event log
<Ameh/>