Table of Contents
Table of Contents ............................................................................................................................ 2
1. Why Should You Learn System Design? ..................................................................................... 4
It Matters at Every Stage of Your Career ...................................................................................... 4
Real-World Moments That Make You Think About System Design .............................................. 4
2. What is System Design? .............................................................................................................. 5
2.1 Low-Level Design (LLD) ......................................................................................................... 5
2.2 High-Level Design (HLD) ........................................................................................................ 5
3. Why Do We Need Distributed Systems? ...................................................................................... 5
Limitations of a Single Machine .................................................................................................... 5
What Distributed Systems Solve .................................................................................................. 6
4. Vertical Scaling vs Horizontal Scaling .......................................................................................... 6
4.1 Vertical Scaling (Scale Up) ..................................................................................................... 6
4.2 Horizontal Scaling (Scale Out) ................................................................................................ 6
4.3 Comparison: Vertical vs Horizontal Scaling ............................................................................ 7
5. Real-Life Story: How a Website Scales ........................................................................................ 8
The Del.icio.us Story (2003) ......................................................................................................... 8
The Problem Del.icio.us Solved ................................................................................................ 8
The Core Functionality — Simplified ......................................................................................... 8
6. DNS: How Browsers Find Your Server ......................................................................................... 8
The Core Problem ........................................................................................................................ 8
Step 1 — Buying a Domain Name ................................................................................................ 8
Step 2 — Linking Domain to Your Server (A Record) ................................................................... 8
Step 3 — DNS Servers: The Distributed Directory ........................................................................ 9
7. Handling Traffic & Deployments — Load Balancer Introduction ................................................... 9
The Single Server Bottleneck ....................................................................................................... 9
Problem A — Deployment Downtime ........................................................................................ 9
Problem B — Traffic Spikes & Server Crashes ......................................................................... 9
The Solution: Adding Multiple Servers .......................................................................................... 9
8. Running Out of Storage — Sharding .......................................................................................... 10
The Storage Crisis ...................................................................................................................... 10
Choosing the Sharding Key ........................................................................................................ 10
Shard Mapping Algorithms ......................................................................................................... 10
Approach 1: Modulo Hashing (userId % number_of_shards) .................................................. 10
Approach 2: Range-Based Sharding ....................................................................................... 11
9. Consistent Hashing .................................................................................................................... 11
How It Works — Step by Step .................................................................................................... 11
Implementation Details ............................................................................................................... 12
📸 @codenexuswithashish Page 2 LinkedIn · TopmateSystem Design Notes · Distributed Systems & Load Balancing
The Problem with Basic Consistent Hashing .............................................................................. 12
The Fix: Virtual Nodes (Vnodes) ................................................................................................. 13
10. Deep Dive: Load Balancer ....................................................................................................... 13
10.1 What is a Load Balancer? ................................................................................................... 13
10.2 Core Concept & Architecture .............................................................................................. 13
10.3 Benefits: Scalability (Zero-Downtime Deployments) ........................................................... 14
10.4 Benefits: Resilience & High Availability ............................................................................... 14
Auto-Scaling (Dynamic Capacity) ............................................................................................ 14
Health Checks (Automatic Failure Detection) .......................................................................... 15
10.5 Benefits: Security (DDoS Protection) .................................................................................. 15
10.6 Benefits: Performance (SSL Offloading & Compression) .................................................... 15
SSL/TLS Termination .............................................................................................................. 15
Traffic Compression ................................................................................................................ 15
10.7 How a Load Balancer Works: The Reverse Proxy .............................................................. 16
Security Benefit of Reverse Proxy ........................................................................................... 16
10.8 Health Checks .................................................................................................................... 16
Example AWS Health Check Configuration ............................................................................ 16
10.9 How Load Balancers Scale Themselves ............................................................................. 17
10.10 Load Balancing Algorithms ............................................................................................... 17
Algorithm 1: Round Robin (Most Common) ............................................................................. 17
Algorithm 2: Weighted Round Robin ....................................................................................... 17
Algorithm 3: IP Hash ............................................................................................................... 17
10.11 Types of Load Balancers .................................................................................................. 17
11. Further Reading & Questions to Explore .................................................................................. 18
Question 1: Global Server Load Balancing (GSLB) .................................................................... 18
Question 2: Session Stickiness .................................................................................................. 18
Question 3: Static vs Dynamic Content ...................................................................................... 18
12. References & Learning Resources........................................................................................... 18
YouTube Channels ..................................................................................................................... 18
Websites & Documentation ........................................................................................................ 18
Diagramming Tool ...................................................................................................................... 19
13. Guideline for Future Notes ....................................................................................................... 19
What High-Level Design (HLD) Notes Will Cover ....................................................................... 19
What HLD Notes Will NOT Cover ............................................................................................... 19