System DesignArchitectureScalabilityReliabilityInterviews

What is System Design?

System design is the process of taking a problem and building a scalable, reliable product out of it. Learn the core layers, the step-by-step approach, and why this skill defines senior engineers.

15 min read9 sections
01

The Core Idea

When someone says "design a system," they actually mean three things:

  • Define the architecture — the big picture
  • Identify the components — the building blocks
  • Design how everything works together — the interactions and data flow

System design is not about memorizing solutions. It's a structured way of thinking about problems at scale. You take a vague requirement like "build Instagram" and turn it into a concrete, working architecture with clear responsibilities, well-defined APIs, and a plan for what happens when things go wrong.

🔥 Key Insight

System design is not about building parts — it's about designing how parts work together at scale, reliably.

02

The 3 Layers of System Design

Every system design problem can be broken down into three layers. Think of them as zoom levels — you start wide and progressively focus in.

🌐

Architecture Design

The 10,000-foot view. What kind of system are we building? What are the major building blocks — web servers, databases, caches, load balancers?

🧩

Component Design

Break the architecture into individual services with clear, single responsibilities. Auth Service handles login. Feed Service generates timelines. Media Service stores files.

🔄

Interaction Design

The glue. How do components talk to each other? What's the data flow? How does the system solve the problem end-to-end? This is the most important layer.

The three layers of system design: architecture (big picture), components (building blocks), and interactions (the glue)

Example: Designing Facebook

📱

Client

Web / Mobile app

⚖️

Load Balancer

Distributes traffic

🖥️

Web Server

Handles requests

Cache

Redis / Memcached

🗄️

Database

Persistent storage

Component Breakdowntext
Architecture (Big Picture):
Client apps, Load balancers, Web servers, Cache layer, Databases

Components (Individual Services):
Auth ServiceHandles login, signup, token management
Feed ServiceGenerates personalized user feed
Media ServiceStores and serves images/videos
Notification SvcPush notifications, emails
Search ServiceFull-text search across posts/users

Interactions (How They Connect):
ClientLoad BalancerAuth Service (verify token)
Auth ServiceFeed Service (fetch personalized feed)
Feed ServiceCache (check for cached feed)
Feed ServiceDatabase (query posts if cache miss)
Feed ServiceMedia Service (resolve image URLs)

💡 Goal of Component Design

Each component should have a single, clear responsibility. If you can't describe what a service does in one sentence, it's doing too much.

03

How It Maps to Real Products

This isn't academic theory. This is exactly how companies build products:

1

Decide the architecture

Leadership and senior engineers define the high-level system — monolith vs microservices, cloud provider, core infrastructure choices.

2

Break into components

The system is divided into services or modules. Each team owns one or more components.

3

Define responsibilities

Clear boundaries are drawn. What does each service own? What does it NOT do? API contracts are defined between teams.

4

Connect everything together

APIs, message queues, event buses, and shared databases tie the components into a working product.

⚠️ This is why system design interviews exist

When you join a company, you're shown the architecture first, then your specific component. System design interviews test whether you can think at the architecture level — not just write code inside a single function.

04

Why System Design Matters

🏢

It Mirrors Real Work

Every product is a system. Every engineer works on a part of it. Understanding the whole system makes you effective from day one.

📈

Career Growth

As you grow: less coding, more designing. Senior engineers spend ~80% of their time designing systems, not writing code.

🧠

Structured Thinking

System design teaches you to break big problems into small ones, solve them independently, and combine solutions. This skill applies beyond engineering.

What system design gives you

  • Ability to break down any complex problem
  • Understanding of trade-offs (consistency vs availability)
  • Vocabulary to communicate with senior engineers
  • Confidence in interviews and architecture discussions
  • A mental framework that applies to any tech stack

What happens without it

  • You can code features but can't see the big picture
  • You struggle to debug cross-service issues
  • You hit a career ceiling at mid-level
  • You can't evaluate trade-offs in technical decisions
  • Architecture discussions feel overwhelming

🔥 Insight

Senior engineers are system designers. The code they write is a small fraction of their impact. The systems they design affect every engineer on the team.

05

Mental Model

Think of system design like designing a city. You don't start by laying bricks — you start by zoning neighborhoods, planning roads, and deciding where the power grid goes.

🏙️

Architecture = City Planning

Where do the residential areas, commercial zones, and industrial parks go? This is the high-level layout — the 10,000-foot view of your system.

🏗️

Components = Buildings

Each building has a purpose — hospital, school, fire station. Each component in your system has a single responsibility — auth, payments, notifications.

🛣️

Interactions = Roads & Utilities

Roads connect buildings. Power lines deliver electricity. Water pipes reach every home. APIs, message queues, and data flows are the roads of your system.

The Mental Modeltext
System Design = Architecture + Components + Interactions

Think of it as:

  🏙️ CITY PLANNING          →  🌐 ARCHITECTURE
  "Where does everything go?"    "What's the high-level structure?"

  🏗️ BUILDINGS               →  🧩 COMPONENTS
  "What does each one do?"       "What's each service responsible for?"

  🛣️ ROADS & UTILITIES       →  🔄 INTERACTIONS
  "How is everything connected?" "How do services communicate?"

The city works because:
Each building has a clear purpose
Roads connect the right places
Utilities scale to serve everyone
There's a plan for emergencies (fault tolerance)

Your system should work the same way.
The city planning mental model: architecture is zoning, components are buildings, interactions are roads and utilities

⚠️ The most common trap

Beginners focus on components (the buildings) and forget about interactions (the roads). A system is not a collection of services — it's how those services collaborate to solve a problem end-to-end.

06

Step-by-Step Approach

Use this framework for any system design problem — whether it's an interview question or a real project at work.

1

Break Down the Problem

Divide the problem into smaller sub-problems. Make each part solvable independently. 'Design Twitter' becomes: user auth, tweet creation, feed generation, notifications, search, media storage.

2

Define Components — with clear boundaries

For each component: What is its responsibility? What does it NOT do? Avoid duplication — don't build the same logic twice. Reuse existing components where possible.

3

Define Interactions

How do components communicate? REST APIs, gRPC, message queues, event streams? Define the data flow from user action to final response. Draw the arrows between your boxes.

4

Think About Scaling Challenges

For each component: What happens at 10x traffic? 100x? Where are the bottlenecks? Which components need horizontal scaling? Where do you add caching?

5

Handle Reliability — often ignored, always critical

Fault tolerance: What if a component fails? Does the system degrade gracefully? Availability: Can the system still function with partial failures? Data consistency: What happens during network partitions?

The 5-step framework: break down → components → interactions → scale → reliability
Applying the Framework: Design a URL Shortenertext
Step 1Break Down:
URL shortening (create short link)
URL redirection (resolve shortlong)
Analytics (track clicks)
User management (optional)

Step 2Components:
Shortener ServiceGenerates unique short codes
Redirect ServiceLooks up short codereturns long URL
Analytics ServiceLogs click events asynchronously
DatabaseStores URL mappings

Step 3Interactions:
UserAPI GatewayShortener ServiceDatabase (write)
UserAPI GatewayRedirect ServiceCacheDatabase (read)
Redirect ServiceMessage QueueAnalytics Service (async)

Step 4Scale:
Redirect Service is read-heavyadd cache (Redis)
Short code generationpre-generate codes to avoid contention
Analyticsasync processing via message queue

Step 5Reliability:
Cache missfallback to database (graceful degradation)
Analytics queue fulldrop events, don't block redirects
Database replication for read availability
URL shortener end-to-end: the 5-step framework applied to a real system design problem

💡 Interview Tip

Always start with Step 1. Interviewers want to see you break down the problem before jumping into solutions. Spend the first 3–5 minutes clarifying requirements and identifying sub-problems.

07

Common Mistakes

These are the mistakes that trip up most people — in interviews and in real projects.

🏃

Jumping straight to components

Starting with 'I'll use Redis and Kafka' before understanding the problem. You're picking tools before knowing what you're building.

Spend the first few minutes clarifying requirements, identifying core use cases, and defining the high-level architecture before naming any technology.

🔗

Ignoring interactions

Drawing boxes on a whiteboard but never explaining how they communicate. A system without defined interactions is just a list of services.

For every arrow between components, specify: the protocol (REST, gRPC, async), the data format, and what happens on failure.

💥

Skipping fault tolerance

Designing only for the happy path. What happens when the database goes down? When a service is slow? When the network partitions?

For each component, ask: 'What if this fails?' Design fallbacks, retries with backoff, circuit breakers, and graceful degradation.

📦

Duplicating logic across services

Building the same validation, auth check, or data transformation in multiple services. This creates maintenance nightmares and inconsistency.

Extract shared logic into a common library or a dedicated service. Define clear ownership boundaries.

🔬

Over-engineering from the start

Designing for 1 billion users on day one when you have 100. Adding Kafka, Kubernetes, and microservices before you need them.

Design for your current scale with a clear path to grow. Start simple, identify bottlenecks, and scale the parts that need it.

08

Why This Matters in the Real World

System design isn't just an interview topic. It's the skill that separates engineers who build features from engineers who build products.

Q:How does Netflix serve 200+ million users without going down?

A: Architecture: CDN edge servers cache content close to users. Components: Separate services for recommendations, streaming, billing, user profiles. Interactions: Async event-driven communication between services. Reliability: Circuit breakers (Hystrix), chaos engineering (Chaos Monkey), multi-region failover. Every concept from this page is at play.

Q:Why did Twitter's Fail Whale happen?

A: Twitter's early monolithic architecture couldn't handle the interaction patterns at scale. The feed generation was tightly coupled to the write path — every tweet triggered fan-out to all followers synchronously. The fix? Decompose into components (tweet ingestion, fan-out service, timeline cache) with async interactions via message queues.

Twitter's evolution: from a monolith with synchronous fan-out to decomposed services with async message queues

Q:How does Uber match riders to drivers in real-time?

A: Architecture: Geospatial indexing + real-time event processing. Components: Location Service (tracks driver positions), Matching Service (finds optimal driver), Pricing Service (surge calculation), Dispatch Service (sends ride to driver). Interactions: WebSocket for real-time updates, geospatial queries for proximity matching, async events for analytics.

The pattern is always the same

Netflix, Twitter, Uber — different products, same approach. Define the architecture. Break into components. Design the interactions. Plan for scale and failure. The framework from Section 06 applies to every system you'll ever build.

09

Quick Revision

Quick Revision Cheat Sheet

System Design: Taking a problem and building a scalable, reliable product. Architecture + Components + Interactions.

Architecture: The 10,000-foot view. Major building blocks — servers, databases, caches, load balancers.

Components: Individual services with single responsibilities. Auth, Feed, Media, Notifications.

Interactions: How components communicate. APIs, queues, events. The most important layer.

5-Step Framework: Break down → Define components → Define interactions → Scale → Reliability.

Scaling: For each component: what happens at 10x? Bottlenecks? Caching? Horizontal scaling?

Reliability: Fault tolerance + availability. What if a component fails? Graceful degradation.

Career impact: Senior engineers spend ~80% time designing, ~20% coding. System design = career growth.