Skip to content

๐Ÿ“ก Level 1 โ€” Foundations (Introduction) โ€‹

Welcome to System Design Mastery! ๐Ÿš€

This is where every journey in this project begins. Before you design Netflix, Uber, or a billion-user notification system, you need to understand how the internet and distributed systems actually work โ€” DNS, HTTP, load balancers, CDNs, proxies, and fault tolerance.

Everything in this project builds on Level 1. Master these foundations first, then every later module will make sense.


๐Ÿ“š Table of Contents โ€‹

  1. Project Overview โ€” Why Foundations Matter
  2. How Foundations Build the Full Curriculum
  3. The Foundation Stack โ€” Layers Explained
  4. Real Example: What Happens When You Open a Website
  5. How the Web Works
  6. Load Balancing
  7. DNS โ€” Domain Name System
  8. CDN โ€” Content Delivery Network
  9. Proxies: Forward vs Reverse
  10. Design Patterns in System Design
  11. Server Crashes & Fault Tolerance
  12. Clustering Fundamentals
  13. Native Mobile Stacks
  14. Practice Exercise
  15. Checklist & Deep Dives

1.1 Project Overview โ€” Why Foundations Matter โ€‹

System Design Mastery (SDM) is a free, structured learning platform that teaches you how to design large-scale distributed systems โ€” the same kind of architectures used at Google, Netflix, Uber, Amazon, and Meta.

What This Project Teaches โ€‹

GoalHow SDM Helps
Interview preparationStep-by-step frameworks for system design interviews
Production engineeringReal-world architectures with trade-offs and capacity math
Career growthProgressive path from beginner to senior architect
Community learningOpen-source docs with diagrams, code, and case studies

Mission in One Sentence โ€‹

Democratize system design knowledge โ€” make advanced architectural concepts accessible through structured learning, visual diagrams, and real-world examples.

Why Level 1 Comes First โ€‹

Every advanced topic in this project โ€” scaling, databases, caching, microservices, Kafka, Netflix architecture โ€” assumes you already understand:

  • How a browser reaches a server (DNS, TCP, HTTP)
  • How traffic is distributed (load balancers, proxies)
  • How content is delivered fast globally (CDN)
  • What happens when a server crashes (fault tolerance, clustering)
text
Without foundations โ†’ you memorize patterns but cannot explain WHY they exist.
With foundations     โ†’ you design systems with confidence and clear reasoning.

TIP

New to the project? Read the full curriculum map: Complete Guide Life Flow.


1.2 How Foundations Build the Full Curriculum โ€‹

SDM is organized into 12 progressive levels. Level 1 is the base layer โ€” every other level stacks on top of it.

How Each Foundation Topic Powers Later Levels โ€‹

Foundation (Level 1)Used Later InReal Example
DNSAll levelsResolving api.netflix.com to the right region
Load BalancingScalability, MicroservicesDistributing 1M req/sec across API servers
CDNCaching, Real-World SystemsServing Instagram images from Tokyo edge node
Reverse ProxyMicroservices, API GatewayNginx routing /orders to Order Service
HTTP / ProtocolsAPIs, gRPC, MessagingREST endpoints, WebSocket chat
Fault ToleranceDesign Patterns, MonitoringCircuit breaker when Payment Service is down
ClusteringScalability, DatabasesHorizontal scaling of stateless web servers
Architecture LayersCase Studies, Interview PrepClient โ†’ LB โ†’ API โ†’ Cache โ†’ DB diagram

INFO

The homepage Get Started button links directly here โ€” because every learner must start with foundations before jumping to Netflix or Uber case studies.


1.3 The Foundation Stack โ€” Layers Explained โ€‹

Every modern web application follows the same layered pattern. Level 1 teaches you each layer so you can draw this diagram in any interview.

Layer Responsibilities โ€‹

LayerJobAnalogy
DNSTranslate google.com โ†’ IP addressPhone book for the internet
CDNServe images/CSS/JS from servers near the userLocal warehouse instead of shipping from HQ
Load BalancerSpread requests across multiple serversTraffic cop at a busy intersection
API ServersRun business logic (login, post, pay)The brain of the application
CacheStore hot data in memory for speedSticky notes on your desk for frequent lookups
DatabasePermanent storage โ€” source of truthFiling cabinet with all records
Object StorageStore large files (images, videos)Cloud photo album (S3, GCS)

TIP

Full breakdown with code: High-Level System Architecture


1.4 Real Example: What Happens When You Open a Website โ€‹

This is the classic interview question and the best way to see all Level 1 concepts working together. When you type https://google.com in your browser:

Step-by-Step (Plain English) โ€‹

  1. DNS โ€” Browser asks "where is google.com?" and gets an IP address
  2. TCP + TLS โ€” Secure connection is established (HTTPS)
  3. CDN โ€” Static assets (images, CSS) served from a nearby edge server
  4. Load Balancer โ€” Dynamic requests routed to one of many web servers
  5. Web Server โ€” Processes the request, talks to database if needed
  6. Response โ€” HTML or JSON sent back to your browser

TIP

Full deep dive with caching layers: What Happens When You Type Google.com


1.5 How the Web Works โ€‹

When you type a URL in your browser, a complex sequence of events is triggered to resolve the name and fetch the content.

System Architecture Flow โ€‹

HTTP Request-Response Cycle โ€‹

๐Ÿ’ป JS Example: Basic Fetch โ€‹

Most web interactions start with a fetch request in JavaScript.

javascript
async function getPageData() {
  try {
    const response = await fetch("https://api.example.com/data");
    if (!response.ok) throw new Error("Network response was not ok");
    const data = await response.json();
    console.log("Success:", data);
  } catch (error) {
    console.error("Error fetching data:", error);
  }
}

TIP

Protocols deep dive: Protocols & Communication ยท Networking Fundamentals


1.6 Load Balancing โ€‹

A Load Balancer distributes incoming traffic across multiple servers so no single server is overwhelmed. It is the foundation of horizontal scaling.

Types of Load Balancing โ€‹

TypeDescriptionUse Case
Round RobinEach server gets requests in turnEqual server capacity
Least ConnectionsSends to least busy serverVarying request lengths
IP HashSame client โ†’ same serverSession persistence
WeightedPowerful servers get more trafficMixed hardware

Visualizing Load Distribution โ€‹

๐Ÿ’ป JS Example: Simplified Round Robin โ€‹

javascript
class LoadBalancer {
  constructor(servers) {
    this.servers = servers;
    this.currentIndex = 0;
  }

  getNextServer() {
    const server = this.servers[this.currentIndex];
    this.currentIndex = (this.currentIndex + 1) % this.servers.length;
    return server;
  }
}

const lb = new LoadBalancer(["Server-A", "Server-B", "Server-C"]);
console.log(lb.getNextServer()); // Server-A
console.log(lb.getNextServer()); // Server-B

1.7 DNS โ€” Domain Name System โ€‹

DNS translates human-readable domain names (like example.com) to IP addresses computers understand.

DNS Resolution Flow โ€‹


1.8 CDN โ€” Content Delivery Network โ€‹

CDNs cache static content (images, CSS, JS) at servers close to users globally to reduce latency. Used by Netflix, Instagram, and every major website.

CDN Flow Diagram โ€‹

INFO

CDN optimization is covered in depth at Level 4 โ€” CDN Optimization.


1.9 Proxies: Forward vs Reverse โ€‹

NOTE

Forward Proxy: Protects/hides the client (e.g., corporate firewall). Reverse Proxy: Protects/optimizes the server (e.g., Nginx in front of API servers).

Visual Comparison โ€‹

๐Ÿ’ป JS Example: Reverse Proxy Logic (Node.js style) โ€‹

javascript
const http = require("http");
const httpProxy = require("http-proxy");

const proxy = httpProxy.createProxyServer({});

http
  .createServer((req, res) => {
    const target = "http://localhost:8080";
    console.log(`Forwarding request to: ${target}`);
    proxy.web(req, res, { target });
  })
  .listen(3000);

1.10 Design Patterns in System Design โ€‹

Understanding how design patterns (micro level) fit into system design (macro level) is crucial for this project.

LevelScopeExample
Code patternsSingle applicationSingleton, Factory, Observer
System patternsDistributed architectureCircuit Breaker, Saga, Event Sourcing

Dedicated guides in this module:

INFO

Advanced patterns live at Level 9 โ€” Design Patterns.


1.11 Server Crashes & Fault Tolerance โ€‹

In distributed systems, we assume servers will crash. Health checks, redundancy, and stateless servers keep the system alive.

Redundancy & Re-routing โ€‹


1.12 Clustering Fundamentals โ€‹

A cluster is a group of servers (nodes) that work together as one system. Clusters are the foundation for horizontal scaling and high availability.

The Cluster Model โ€‹


1.13 Native Mobile Stacks โ€‹

Choosing how to build native mobile apps affects team skills, release process, and OS integration. Compare React Native, Flutter, and Kotlin (Android native) โ€” and when Kotlin Multiplatform fits.


๐Ÿงช Practice Exercise โ€‹

Design the networking layer for a simple blog โ€” this exercise ties every Level 1 concept together:

  • 1 million monthly readers
  • Static images + dynamic posts
  • Global audience

Think through: DNS โ†’ CDN โ†’ Load Balancer โ†’ Web Servers โ†’ Database

๐Ÿ‘‰ View the Full Solution


โœ… Checklist Before Moving On โ€‹

  • [ ] I understand why Level 1 is the base of the entire SDM project
  • [ ] I can draw the foundation stack (Client โ†’ DNS โ†’ CDN โ†’ LB โ†’ API โ†’ Cache โ†’ DB)
  • [ ] I can explain what happens when you type a URL in the browser
  • [ ] I understand how DNS resolves a domain name
  • [ ] I can explain what a load balancer does and name 2 algorithms
  • [ ] I know the difference between forward and reverse proxy
  • [ ] I understand what a CDN is used for
  • [ ] I know why fault tolerance and clustering matter
  • [ ] I completed the simple blog practice exercise

๐Ÿ“– All Deep Dives in This Module โ€‹

TopicPage
Complete curriculum mapGuide Life Flow
Type google.com โ€” full breakdownWhat Happens When You Type Google
High-level architecture layersHigh-Level Architecture
Networking fundamentalsNetworking
Protocols (HTTP, TCP, WebSocket)Protocols & Communication
DNS resolution & cachingDNS Lookup
Load balancing algorithmsLoad Balancing Algorithms
Fault tolerance & crashesFault Tolerance & Crashes
Clustering & HAClustering Fundamentals
GoF design patternsDesign Patterns
System design patternsSystem Design Patterns
Mobile stack comparisonNative Mobile Stacks
Simple blog practicePractice: Simple Blog
Personal learning journeyHow I Learned System Design

โžก๏ธ Next: Level 2 โ€” Scalability

Released under the ISC License.