Chapter 1 of 2
Course Progress0 of 2 completed (0%)

Modern System Design & API Architecture · Chapter 1 · ~15 min · Beginner

Client-Server Architecture & How the Web Works

Learn the foundational mental model behind every web and mobile app on earth: the Client-Server model, what happens when you type a URL, 3-tier architecture, and why latency vs bandwidth matters.

  • Master the Client-Server mental model with simple analogies
  • Trace what happens when you type a web URL step by step
  • Understand the 3-Tier Architecture (Frontend, Backend, Database)
  • Learn the critical difference between Latency and Bandwidth

1The Client-Server Model: The Restaurant Analogy

Every system on the internet — from Instagram and YouTube to your banking app — operates on a simple relationship called the Client-Server Model.

Think of it like visiting a restaurant:

The Customer

The Client

Your laptop browser or smartphone app. It places an order: "Please show me my profile page."

The Waiter

The Network (HTTP)

Takes your request across the internet to the kitchen, and brings back the response.

The Kitchen

The Server & DB

Prepares the data, verifies your password, queries the database, and returns the result.

Concept Check

In the Client-Server architecture, what role does a web browser (like Chrome or Safari) play?

2What Happens When You Type google.com?

This is the #1 most asked question in software engineering and system design interviews. When you hit Enter in your browser:

1. DNS Lookup (Finding the Address)

Computers don't speak human names like "google.com"; they speak numerical IP addresses (like 142.250.190.46). The browser asks the Domain Name System (DNS) to look up the IP address.

2. Establishing Connection (TCP & TLS)

The client connects to that IP address and establishes an encrypted HTTPS tunnel so no eavesdropper can intercept your data.

3. HTTP GET Request

The client sends an HTTP message: GET / HTTP/1.1.

4. Server Response

The server replies with 200 OK and provides the HTML, CSS, and images to draw the page.

Concept Check

What is the purpose of the Domain Name System (DNS) on the internet?

3The 3-Tier Architecture of Modern Apps

Nearly every web application you interact with is organized into three distinct tiers:

Tier 1: Presentation

Frontend

HTML, CSS, JavaScript, and React. Runs inside the user's browser or mobile phone screen.

Tier 2: Logic

Backend (API)

Node.js, Python, or Java. Handles business logic, checks credentials, and processes orders.

Tier 3: Storage

Database

PostgreSQL, MySQL, or MongoDB. Safely and permanently stores user accounts, posts, and transactions.

4Latency vs. Bandwidth: Why Speed is King

In system design, people often confuse these two fundamental performance metrics:

Bandwidth (The Pipe Width)

How much data can travel through the network per second (e.g. 100 Mbps or 1 Gbps). Think of this like the number of lanes on a highway.

Latency (The Speed of Travel)

How long it takes for a single packet to travel from Client to Server and back (measured in milliseconds, ms). Think of this like the speed limit. Even with a 10-lane highway, traveling from New York to Sydney still takes time!

Concept Check

If a website has a high bandwidth connection (1 Gbps) but users in Australia experience 300ms delays when clicking buttons on a server in New York, what is the problem?

5Hands-On: Step Through a Live Web Request

Click "Next Step" to trace a web packet traveling across the internet from client to DNS, backend, and database:

Journey of a Web Request (From Click to Screen)

Step 1 of 5

1. User Enters URL & DNS Lookup

Latency: ~15 ms

You type 'codershub.com'. The browser asks a DNS server (the Internet's phonebook): 'What is the numerical IP address for this name?' DNS replies: '76.76.21.21'.

Component Involved:Client Browser / Phone

6Chapter Knowledge Challenge

Test your understanding of DNS, client-server models, latency, and 3-tier architectures:

Concept Check 1 of 2
1

What is the difference between Latency and Bandwidth?

Concept Check 2 of 2
2

Why are backend application servers typically kept stateless in modern web architecture?

7Recap

  • The Client requests data; the Server processes requests and returns responses.
  • DNS translates readable domain names into IP addresses.
  • Web apps use a 3-tier architecture: Frontend (presentation), Backend (logic), and Database (storage).
  • Bandwidth is volume capacity; Latency is time delay. Distance creates latency.

Ready for Chapter 2? Mark this chapter as complete to proceed:

Enjoying this free lesson? Your support helps us build more free animated chapters.

Support Us