← All notes

System Design Roadmap: From Foundations to Interview-Ready

10 min read

System design feels huge because people try to learn it all at once: caches, queues, sharding, CAP, Kafka, and a dozen boxes-and-arrows diagrams. It becomes manageable when you learn it in layers, where each phase gives you the vocabulary the next one needs.

This roadmap has seven phases. Do them in order. Each ends with something you should be able to explain out loud, because system design is a spoken skill as much as a technical one.

Foundations → Core Architecture → Databases → Distributed Systems
        → Patterns → Full Case Study → Interview Practice

Phase 1: System Design Foundations

Before drawing any architecture, learn to talk about what a system must do and how well it must do it.

  • What is system design? Deciding how components (clients, servers, data stores, queues) fit together to meet requirements at a given scale. There is rarely one right answer, only trade-offs you can justify.
  • Functional vs non-functional requirements. Functional: what the system does ("users can place an order"). Non-functional: how well ("checkout p99 under 300 ms, 99.99% available"). Most design decisions are driven by the non-functional ones.
  • Scalability. Can the system handle 10× the load without a rewrite?
  • Availability. The fraction of time the system is up and serving. "Four nines" (99.99%) is about 52 minutes of downtime a year.
  • Reliability. Does it behave correctly over time, including under failure? A system can be available but wrong.
  • Latency and throughput. Latency is time per request; throughput is requests per second. Optimizing one often costs the other.
  • Capacity estimation. Back-of-the-envelope math: users → requests per second → storage per year → bandwidth. You are after the right order of magnitude, not precision.
  • Vertical vs horizontal scaling. Vertical means a bigger machine: simple, but capped and a single point of failure. Horizontal means more machines: nearly unlimited, but you now have distributed-systems problems.
  • Monolith vs microservices. A monolith is simpler to build, test, and deploy. Microservices let teams scale and deploy independently, at the cost of network calls, operational overhead, and data consistency headaches. Start with a well-structured monolith unless you have a reason not to.

Checkpoint: given "design a URL shortener," you can list its requirements and estimate its read/write QPS and storage.

Phase 2: Core Architecture

These are the building blocks you will reuse in every design.

  • Client-server architecture. Clients send requests, servers respond. Everything else is layered on this.
  • API Gateway. A single entry point that handles routing, authentication, rate limiting, and request aggregation, so individual services don't each reimplement them.
  • Load balancers. Spread traffic across servers, run health checks, and remove dead instances. Know L4 vs L7 and algorithms such as round-robin and least-connections.
  • Application servers. Keep them stateless where possible so any instance can serve any request, which is what makes horizontal scaling easy.
  • Database architecture. Where the source of truth lives, and how the app reaches it (connection pooling, read replicas).
  • Cache. Memory in front of slow storage (Redis, Memcached). The biggest latency win per unit of effort, and the biggest source of stale-data bugs.
  • Message queues. Decouple producers from consumers (Kafka, RabbitMQ, SQS). They absorb traffic spikes and enable async work like emails and image processing.
  • Object storage. Cheap, durable storage for large blobs such as images, videos, and backups (S3). Don't put these in your database.
  • CDN. Serve static and cacheable content from edge locations near the user.

Checkpoint: you can sketch a typical web architecture from memory and say why each box is there.

Phase 3: Database Design

Most systems are really data systems. Mistakes here are the most expensive to fix later.

  • SQL vs NoSQL. Relational databases give you joins, constraints, and transactions. NoSQL stores (document, key-value, wide-column, graph) trade some of that for flexible schemas and easier horizontal scaling. Choose by access pattern, not fashion.
  • Schema design. Model entities and relationships, and decide where to normalize and where to denormalize for read speed.
  • Indexes. They turn full scans into lookups, but slow down writes and use storage. Learn B-trees, composite indexes, and why column order matters.
  • Transactions and ACID. Atomicity, Consistency, Isolation, Durability. Know isolation levels and the anomalies each one allows.
  • Database replication. Leader-follower copies for read scaling and failover. Understand replication lag and what it means for "read your own writes."
  • Sharding. Splitting data across machines by a shard key. A bad key creates hot spots; cross-shard queries and transactions get painful.
  • Read/write patterns. Read-heavy systems lean on caches and replicas. Write-heavy ones lean on partitioning, batching, and append-only structures.

Checkpoint: for any feature, you can justify the store, the schema, and the indexes from its query patterns.

Phase 4: Distributed Systems Concepts

Once data or compute spans machines, the network becomes part of your failure model.

  • Consistency. Do all readers see the latest write (strong), or eventually (eventual)? Pick per use case: payments need strong, a like counter doesn't.
  • Replication. Synchronous gives safety at the cost of latency. Asynchronous gives speed at the risk of losing recent writes.
  • Partitioning / sharding. The same idea as Phase 3, now with rebalancing, consistent hashing, and routing.
  • Fault tolerance. Assume machines, disks, and networks will fail. Remove single points of failure and degrade gracefully.
  • Race conditions. Two requests touching the same data at once, such as two buyers taking the last item in stock. Solve them with transactions, optimistic locking, or atomic operations.
  • Idempotency. Doing an operation twice has the same effect as doing it once. Essential once retries exist, and the reason payment APIs take idempotency keys.
  • Retries. Use exponential backoff with jitter, set limits, and only retry safe operations. Naive retries cause retry storms that take down a struggling service.
  • CAP theorem. During a network partition you must choose between consistency and availability. Learn it as "what do we sacrifice when the network splits?" rather than as a slogan.

Checkpoint: you can explain what happens to a write when a replica or a network link dies midway.

Phase 5: System Design Patterns

Reusable solutions to recurring problems.

  • Caching strategies. Cache-aside, write-through, write-back, and TTLs and invalidation. Also cache stampedes and how to prevent them.
  • Rate limiting. Token bucket, leaky bucket, sliding window. Protects you from abuse and from your own clients.
  • Circuit breakers. Stop calling a failing dependency so failures don't cascade, then probe to see when it recovers.
  • Event-driven architecture. Services react to events instead of calling each other directly, which reduces coupling and adds eventual consistency.
  • Pub/Sub. One event, many independent subscribers.
  • Saga pattern. A distributed transaction broken into local steps with compensating actions on failure (reserve stock → charge payment → if payment fails, release stock).
  • CQRS. Separate the write model from the read model so each can be shaped and scaled for its job.
  • Distributed locks. Mutual exclusion across machines (Redis, ZooKeeper, etcd). Tricky: you need expiry, fencing tokens, and a clear answer to "what if the lock holder pauses?" Often a better design avoids needing one.

Checkpoint: given a failure scenario, you can name the pattern that contains it.

Phase 6: Design Myntra — A Full Interview Case Study

Now put everything together on one realistic system: a large fashion e-commerce platform. Work through it in the same order you would in an interview.

Requirements
    ↓
Capacity Estimation
    ↓
API Design
    ↓
Database Design
    ↓
High-Level Architecture
    ↓
Deep Dive into Components
    ↓
Scaling
    ↓
Reliability & Failure Handling
    ↓
Trade-offs
  1. Requirements. Functional: browse and search catalog, product pages, cart, checkout, payments, order tracking, returns. Non-functional: low-latency browsing, high availability, and strong correctness for inventory and payments. Clarify scope aloud, including what you are not building.
  2. Capacity estimation. Pick numbers (daily active users, browse-to-order ratio) and derive QPS. Remember that e-commerce is spiky: a flash sale can be 10–50× normal traffic, so design for the peak, not the average.
  3. API design. Define the core endpoints (GET /products, POST /cart/items, POST /orders, POST /payments), with pagination, authentication, and idempotency keys on anything that moves money.
  4. Database design. Catalog in a document store or relational DB with search offloaded to a search index; users, orders, and payments in a relational DB for transactions; inventory with careful concurrency control; carts in Redis or a similar fast store.
  5. High-level architecture. CDN → API gateway → services (catalog, search, cart, inventory, order, payment, notification) → data stores and queues. Draw it, then narrate one request end to end.
  6. Deep dive. Choose the hard parts: how search and ranking work, how inventory avoids overselling, how the order flow is orchestrated as a saga across inventory and payment, and how the product page gets cached.
  7. Scaling. Cache hot products, replicate reads, shard orders by user ID, queue non-critical work, pre-scale and use a waiting room for sale events.
  8. Reliability and failure handling. Timeouts, retries with idempotency, circuit breakers, graceful degradation (recommendations down? the page still loads), and what happens when the payment provider is slow.
  9. Trade-offs. Say them out loud: consistency vs availability for inventory, cache freshness vs latency, microservices vs simplicity, cost vs headroom. This is where interviewers decide how senior you sound.

Checkpoint: you can walk the whole flow in 35–45 minutes without notes, and defend every choice.

Phase 7: Interview Practice

Repeat the Phase 6 framework on different problems. Each one stresses a different muscle:

  • Design Myntra / Amazon. Catalog, search, inventory, checkout, and sale-day spikes.
  • Design Uber. Real-time geospatial matching, location updates at high write rates, and ETA computation.
  • Design a payment system. Idempotency, double-entry ledgers, reconciliation, and strict correctness over speed.
  • Design a notification system. Fan-out, queues, retries, user preferences, and multi-channel delivery (push, SMS, email).
  • Design a search system. Inverted indexes, ranking, indexing pipelines, and freshness vs relevance.

For each one:

  1. Clarify requirements before drawing anything.
  2. Estimate scale and let the numbers drive decisions.
  3. Start simple, then scale the design where the numbers demand it.
  4. Go deep on one or two components rather than skimming all of them.
  5. Always finish with failure modes and trade-offs.

How to actually use this roadmap

  • Don't just read, draw. Redraw each architecture from a blank page until you can do it without peeking.
  • Explain out loud. If you can't teach it to a rubber duck, you don't know it yet.
  • Learn from real systems. Engineering blogs from large companies show how these ideas survive real traffic.
  • Build something small. Add a cache, a queue, and a rate limiter to a side project. A single experience of a cache stampede teaches more than a chapter on it.

System design is a skill built by repeated practice: gather requirements, estimate, draw, break it, and justify the trade-offs. Start with Phase 1 and move on only when you can explain the checkpoint.