You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
System design is the process of defining the architecture, components, modules, interfaces, and data flow for a system to satisfy specified requirements. Whether you are preparing for interviews or building real-world products, understanding system design fundamentals is essential.
Modern software rarely runs on a single machine. Even a simple web application typically involves:
Understanding how these pieces fit together is what separates developers who build prototypes from engineers who build products that serve millions.
Every system design starts with requirements gathering. There are two categories:
These describe what the system should do:
These describe how well the system should perform:
| Requirement | Description | Example |
|---|---|---|
| Scalability | Handle growing load | 100M daily active users |
| Availability | Uptime percentage | 99.99% (52 min downtime/yr) |
| Latency | Response time | p99 < 200ms |
| Consistency | Data correctness | Strong or eventual |
| Durability | Data is not lost | No data loss on failure |
| Security | Protection from threats | Encryption at rest/transit |
Tip: Non-functional requirements often drive the most important architectural decisions. Two systems with identical features can have completely different architectures based on their scale and latency requirements.
Before diving into design, estimate the scale of the system. This helps you choose appropriate technologies and architectures.
| Operation | Approx. latency |
|---|---|
| L1 cache reference | 0.5 ns |
| Branch mispredict | 5 ns |
| L2 cache reference | 7 ns |
| Mutex lock/unlock | 25 ns |
| Main memory reference | 100 ns |
| SSD random read | 150 μs |
| Read 1 MB sequentially from memory | 250 μs |
| Round trip within same data centre | 500 μs |
| Read 1 MB sequentially from SSD | 1 ms |
| HDD seek | 10 ms |
| Read 1 MB sequentially from HDD | 20 ms |
| Send packet US-East → US-West | 40 ms |
| Send packet US → Europe | 80 ms |
| Send packet US → Australia | 150 ms |
Assume:
Tip: You do not need exact numbers. The goal is to determine the order of magnitude — thousands vs millions vs billions of operations per second.
Use a structured approach when tackling any system design problem:
graph LR
A["1. Clarify: ask questions & scope"] --> B["2. High-level: draw boxes & arrows"]
B --> C["3. Deep dive: detail each component"]
C --> D["4. Wrap up: trade-offs & next steps"]
Before we dive deeper in later lessons, here is a quick overview of the main building blocks:
| Component | Purpose |
|---|---|
| Load Balancer | Distributes requests across servers |
| Web Server | Handles HTTP requests |
| Application Server | Runs business logic |
| Database | Persistent storage (SQL or NoSQL) |
| Cache | Fast in-memory storage for hot data |
| CDN | Serves static content close to users |
| Message Queue | Asynchronous communication between services |
| Search Index | Full-text or structured search |
| Object Storage | Large files (images, videos, backups) |
| API Gateway | Entry point for client requests |