Getting Started
Get started with system design by learning the basics of system design.
1. What is System Design?
System design is the process of defining the architecture, components, and data flow of a system to satisfy specific requirements.
Every system has two types of requirements:
-
Functional Requirements
- What the system should do.
- Example: User can sign up, place an order, upload a file.
-
Non-Functional Requirements
- How well the system does it.
- Example: Scalability, availability, latency, consistency, security.
System design: deciding the structure, components, and data flow of a software system so it works correctly, scales well, and stays reliable.
2. Functional and Non Functional Requirements
2.1 Functional Requirements (FR)
Functional requirements describe what the system should do — the specific features, behaviors, and capabilities users interact with. They define the core business logic.
Characteristics:
- Directly tied to user actions and business use-cases
- Testable ("does clicking this button do X?")
- Usually gathered from product/business requirements
2.2 Non-Functional Requirements (NFR)
Non-functional requirements describe how well the system performs — the quality attributes, constraints, and operational characteristics rather than specific features.
Characteristics:
- Not tied to a single feature — they apply system-wide
- Harder to test with a simple pass/fail; usually measured (ms, %, req/sec)
- This is where senior-level system design thinking lives — trade-offs happen here
| Aspect | Functional Requirements | Non-Functional Requirements |
|---|---|---|
| Definition | What the system should do | How well the system does it |
| Focus | Features & business logic | Quality, performance & constraints |
| Examples | User can log in, place an order, upload a file, search products | System handles 10k req/sec, 99.9% uptime, response under 200ms |
| Impact if missed | Feature is broken or missing | System is slow, crashes under load, or loses data |
| Common categories | Login, CRUD operations, search, notifications | Scalability, availability, latency, security, consistency, maintainability |
Networking Basics
IP Address & Port
- IP Address: Unique identifier for a device on a network (e.g.
192.168.1.1) - Port: A number identifying a specific process/service on that device (e.g.
:8080) - Combined:
IP:PORTtells you exactly where to send a request
DNS (Domain Name System)
- Translates human-readable domain names (
google.com) into IP addresses - Think of it as the "phonebook of the internet"
TCP vs UDP
| Aspect | TCP | UDP |
|---|---|---|
| Full Form | Transmission Control Protocol | User Datagram Protocol |
| Connection | Connection-oriented (handshake required) | Connectionless (no handshake) |
| Reliability | Reliable — guarantees delivery | Unreliable — no delivery guarantee |
| Ordering | Maintains order of packets | No ordering guarantee |
| Speed | Slower (overhead from acks, retransmits) | Faster (minimal overhead) |
| Error Checking | Extensive (checksum + retransmission) | Basic (checksum only, no recovery) |
| Header Size | 20–60 bytes | 8 bytes |
| Use Cases | Web (HTTP/HTTPS), email, file transfer, APIs | Video streaming, gaming, VoIP, DNS |
One-liner to remember: TCP = reliable but slower. UDP = fast but unreliable.
HTTP / HTTPS
- HTTP: Protocol for transferring data over the web (application layer, built on TCP)
- HTTPS: HTTP + encryption (TLS/SSL)
Core Vocabulary Cheat Sheet
-
Latency: Time delay for a single request to complete (ms)
-
Throughput: Number of requests a system can handle per unit time
-
Vertical Scaling: Making a single machine more powerful (more CPU/RAM)
-
Horizontal Scaling: Adding more machines to share the load
-
Availability: System is up and responding when requested
-
Reliability: System performs correctly and consistently over time
-
Redundancy: Keeping extra copies of components or data to avoid a single point of failure.
-
Consistency: All nodes/users see the same data at the same time
-
Durability: Once data is successfully written, it won't be lost even if the system crashes.
-
Fault Tolerance: The ability of a system to continue operating when components fail.
Latency
The time it takes for a request to travel from the client to the server and back.
User ───── Request ─────> Server
User <──── Response ───── Server
Time taken = Latency
Example:
Open Google → page loads in 80 ms Latency = 80 milliseconds
Lower latency is better.
Throughput
The amount of work a system can complete in a given period.
1000 requests / second
500 MB / second
10,000 messages / minute
Example:
A server handles:
5,000 requests every second
Throughput = 5,000 RPS
Higher throughput means the system can serve more users.
Bandwidth
The maximum amount of data that can be transferred per second.
100 Mbps, 1 Gbps
Think of it as the width of a highway.
Wider highway → more cars
Higher bandwidth → more data
Don't confuse Latency (speed of one request) with Throughput (volume of requests handled). A system can have low latency but low throughput, or vice versa.