How Clients and Servers Communicate
What You Will Learn
Understand the basic request-response model and the role of HTTP.
Core Idea
Most web applications use a client-server model.
The client could be a browser or mobile application. The server receives requests, performs business logic, communicates with other systems, and returns a response.
Client -> HTTP Request -> Server
Client <- HTTP Response <- ServerThis simple model is the foundation for many larger systems.
A Simple Mental Model
Client
|
v
Application
|
+--> Database
|
+--> Cache
|
+--> Background WorkerDo not worry about building every component at once. System design is mainly about understanding why a component exists, what problem it solves, and how components communicate.
Practical Example
A login request might look like:
POST /api/login
Content-Type: application/json
{"email":"user@example.com","password":"secret"}The server validates the credentials and returns a response such as:
{"token":"..."}The system can later become distributed, but the basic request-response idea remains.
Key Points
['HTTP is a communication protocol used by many web systems.', 'Clients send requests.', 'Servers process requests and return responses.', 'APIs define how clients interact with services.']
Common Beginner Mistakes
- Adding technologies before understanding the problem.
- Designing for millions of users when the requirements do not justify it.
- Ignoring failure cases.
- Treating every system as if it needs the same architecture.
- Focusing on diagrams instead of explaining the decisions behind them.
Quick Summary
The goal of this lesson is to build a simple mental model that you can reuse in future designs.
Next, you will learn how to design simple APIs that are predictable and easy to evolve.