Course contentsShow
← Software Engineering
Lesson 756 of 1,93324. REST API DesignFree lesson

Client-Server Separation

Separating user interface concerns from data storage concerns to improve portability and scalability.

Client-Server Separation

What you'll learn: You'll learn why separating the user interface from data storage improves application portability and scalability.


The Core Idea

Client-Server Separation is a REST architectural principle that mandates keeping the user interface (client) and data storage (server) as independent components. The client doesn't know or care how data is stored, and the server doesn't know or care how data is displayed. They communicate through a well-defined interface—typically HTTP requests and responses.

Think of it like a restaurant: the kitchen (server) prepares food and manages ingredients, while the dining area (client) presents meals to customers. The kitchen doesn't need to know what color the plates are, and diners don't need to know where ingredients are stored. The waiter (HTTP API) carries information between them.

Why This Matters

Portability: You can replace either side independently. Build a web interface, then add a mobile app—both talk to the same server. Or migrate your database without touching client code.

Scalability: Clients and servers can scale separately. Add more servers to handle data processing, or support thousands of different client devices without server changes.

Evolution: Teams can work independently. Front-end developers improve the UI while back-end engineers optimize data storage, as long as the API contract stays consistent.

In Practice

When you request data from a REST API, the client sends an HTTP request (configuration from previous lessons). The server processes it, accesses data, and returns a response—usually JSON. The client never directly accesses the database. The server never renders HTML.

Key Takeaway: Client-Server Separation decouples the user interface from data storage, enabling independent evolution, scaling, and replacement of each component.