Mind~G
System-Design

Design Requirements

Client and Server

A client is something (a computer, phone, or app) that asks for data or service.

Example: When you open Google in your browser, your browser is the client. It asks Google's servers for search results.

What is a Server

A server is a computer that listens to client requests and gives responses.

Example: Google's computers (servers) store all web data and send you the results you ask for.

Client (You) ---> request ---> Server (Google)
Client (You) <--- response <--- Server (Google)

Database

A database is where data is stored and managed.

Example: When you log into Instagram, your username and password are checked in a database.

Client ---> Server ---> Database

API (Application Programming Interface)

An API is a set of rules that allows different software to talk to each other.

Client ---> API ---> Server ---> Database

Latency

Latency means how much time it takes for a request to travel from client to server and back.

Example: If you click a button and it takes 2 seconds to show results, the latency is 2 seconds.

Lower latency = faster response.

Throughput

Throughput means how many requests a system can handle in one second.

Example: If your system can handle 1000 requests per second, that is the throughput.

High throughput = more users can use the system at the same time.

Scalability

Scalability means how easily your system can grow to handle more users or data.

Example: If your app works well for 100 users, but also works well for 10,000 users after some setup, it is scalable.

Vertical Scaling and Horizontal Scaling

These are two ways to scale a system.

Vertical Scaling (Scaling Up)

You upgrade the same machine — make it more powerful.

Example: Add more CPU or memory to the server.

Before: 1 Server (4GB RAM)
After : 1 Server (16GB RAM)

Good for simple systems, but there is a limit to how big one machine can be.

Horizontal Scaling (Scaling Out)

You add more servers to share the work.

Example: Instead of one server handling all traffic, use 3 servers together.

          +----------------------+
          |     Load Balancer    |
          +----------+-----------+
                     |
     +---------------+---------------+
     |               |               |
 Server 1       Server 2        Server 3

This is more powerful and flexible for large systems.

Load Balancer

A load balancer is like a traffic manager that sends user requests to different servers to balance the work.

Example: If 1000 users visit your website at once, the load balancer spreads them across multiple servers.

        +----------------------+
        |     Load Balancer    |
        +----------+-----------+
                   |
     +-------------+-------------+
     |             |             |
 Client A ---> Server 1          |
 Client B -------------> Server 2|
 Client C -----------------> Server 3

Redundancy

Redundancy means having extra copies of systems or data, in case one fails.

Example: If one server goes down, another one can take over.

Server 1 (Main)
Server 2 (Backup)

If Server 1 fails, Server 2 takes its place. This keeps the system running.

Fault Tolerance

Fault tolerance means your system keeps working even when something fails.

It uses redundancy and other methods to make sure users don't notice a failure.

Example: If one database or server fails, the system automatically switches to another one —> no downtime for users.

Summary

TermMeaningExample
ClientThe user or app sending requestBrowser sending request
ServerThe computer answering requestsGoogle server sending results
DatabaseStores and manages dataUser info in Instagram
APIBridge between client and serverMobile app talking to backend
LatencyDelay time for one request2 seconds to load page
ThroughputRequests per second1000 req/sec
ScalabilityAbility to handle more usersFrom 100 to 10,000 users
Vertical ScalingBigger single serverAdd more RAM
Horizontal ScalingAdd more servers3 servers share work
Load BalancerDistributes trafficSpreads requests evenly
RedundancyBackup componentsBackup server ready
Fault ToleranceKeeps system running on failureSwitch to backup server

On this page