🏗️ System Design and Architecture Notes
A step-by-step roadmap for learning system design, distributed systems, networking, scalability, security, infrastructure, and real-world architecture.
📖 Read the interactive version for a better reading experience.
This guide is useful for:
- Software engineers preparing for system design interviews
- Developers building scalable production systems
- Engineers moving into senior and staff-level roles
How to use this roadmap
Study the phases in order. Each phase builds on the previous one.
- Learn the fundamentals.
- Understand how data is stored and queried.
- Learn how to improve performance.
- Study distributed systems and failure handling.
- Learn networking and service communication.
- Study security and identity.
- Learn how systems run in production.
- Study architecture patterns and integration styles.
- Practice real-world system design problems.
- Review the interview and estimation material regularly.
Do not try to read every topic in one sitting. Complete one subsection, take notes, and then apply the ideas in a small design exercise.
Recommended starting points
Start with these files before moving through the phases:
- Syllabus
- Six Pillars of System Design
- System Design Patterns
- High Scale System Design
- Back-of-the-Envelope Estimation
- Interview Questions
- System Design Problems and Key Solutions
Phase 1: Fundamentals and Design Principles
Goal: Understand the basic properties, constraints, and principles used to design reliable systems.
Core system design concepts
- Six Pillars of System Design
- Non-Functional Requirements
- Non-Functional Requirements: No-Value Trap
- SLA
- SLOs vs SLAs
- ACID
- CAP Theorem
- Consistency vs Integrity
- Idempotency
- Stateless vs Stateful Systems
- Single Server Design
- Two-Tier Architecture
- Project Architecture
- Clear Architecture Principles
- 12-Factor App Principles
- Coupling vs Cohesion
- SOLID
- Single Responsibility Principle
- Open-Closed Principle
- Liskov Substitution Principle
- Dependency Inversion Principle vs Liskov Substitution Principle
- Strategy Design Pattern
- Proof of Concept
- Definition of Done
- Phased Approach
- Measure First Approach
Phase 2: Capacity Planning and Scaling
Goal: Estimate system capacity and understand how to scale services and infrastructure.
- Back-of-the-Envelope Estimation
- CPU Calculation
- IOPS
- Vertical vs Horizontal Scaling
- High Scale System Design
- Scaling Patterns
- Hotspots
- Hot Keys
- Hot Reads and Writes
- Fanout
- Push vs Pull Architecture
- Asynchronous Decoupling
- Backpressure
- Real-Time Backpressure
- Buffer Burst
- Sudden Traffic Spike
- Rate Adaptation and Throttling
- Throttling and Rate Limiting
- Rate Limiting Algorithms
- Distributed Rate Limiter
Phase 3: Databases and Data Modeling
Goal: Learn how to choose databases, model data, and scale storage systems.
Database fundamentals
- SQL vs NoSQL
- Document vs Columnar Databases
- Partition vs Sharding
- Sharding
- Partition Tolerance
- Database Tuning
- Index Fragmentation
- Cursor Pagination
- Data Isolation
- Normalization vs Denormalization
Database technologies and storage systems
- Cassandra
- DynamoDB
- Graph Databases
- Advanced Graph Databases
- Neo4j Basics
- Time Series Databases
- S3
- HDFS
- Data Lakes
- Frontend Storage
- PgBouncer
- Redis Persistence
Transactions and locking
- Serializable Transactions
- MVCC
- Optimistic vs Pessimistic Locking
- Optimistic Lock Exception
- Row-Level Locking
- Locking
- Compare and Swap
- Distributed Locks
- Distributed Locking
- Redis Lock
Replication, consistency, and recovery
- Replication
- Primary Replica Setup
- Data Consistency
- Database Consistency
- Eventual Consistency
- Quorum
- Write-Ahead Logs
- Redo Logs
- Database Durability
- Data Recovery
- Data Replication Migration Process
- Migration
- RTO and RPO
- Failover Switching
- High Availability Clusters
Distributed transactions and data change flows
Phase 4: Caching and Performance
Goal: Reduce latency, improve throughput, and protect backend systems.
- Caching
- Cache Eviction Policies
- Bloom Filters
- Redis Streams
- Lua Scripts
- Latency
- Latency vs Throughput
- Tail and Request Latencies
- Low-Latency Design Patterns
- Preload Strategies
- Post Materializer
- Download and Upload
Phase 5: Distributed Systems
Goal: Understand coordination, consistency, failure handling, and communication between services.
Coordination and consistency
- Replication
- Consistent Hashing
- Leader Election
- Raft Consensus
- Paxos
- Fault Tolerance
- Resiliency
- Cascading Failures
- Chaos Testing
- Exactly Once vs At Least Once Delivery
- Consumer Lag Monitoring
Event-driven architecture
- Event-Driven Architecture
- Event Sourcing
- Event Sourcing vs Outbox
- Outbox Pattern and Operations Dashboard
- CQRS
- Kafka vs RabbitMQ
- Kafka vs Pulsar vs Pub/Sub
Conflict resolution and collaboration
- Conflict Resolution Strategies
- CRDT
- CRDT Deep Dive
- Operational Transformation
- Operational Transformation vs CRDTs
Phase 6: Networking and Communication
Goal: Understand how requests travel through the internet and between services.
Internet and protocols
- The Internet
- How HTTP Works
- HTTP vs HTTPS
- REST Call
- TCP vs UDP
- gRPC
- Encoding
- 200 vs 201 vs 202
- 301 vs 302
- 429 vs 503
Load balancing and request routing
- Load Balancer
- Load Balancing Algorithms
- L4 vs L7
- Load Balancer vs Reverse Proxy
- Load Balancer vs Reverse Proxy vs API Gateway
- API Gateway
- Apigee
- Nginx
- Sticky Sessions
- SSL Termination
Real-time communication
- WebSockets
- Long Polling vs WebSockets
- Short Polling vs Long Polling
- Server-Sent Events
- WebRTC
- Webhooks
Content delivery and location-based systems
Phase 7: Security and Identity
Goal: Design systems that protect users, data, services, and infrastructure.
Authentication and authorization
- JWT
- OAuth 2.0
- OAuth 2.0 Grant Types
- OAuth 2.0 in Liberty
- Opaque Tokens vs JWT
- Identity Provider
- Active Directory
- Access Control Lists and Rule Engine
- Rule Engine
- Short-Circuit Authentication
- Refresh Token Protection
- Brute-Force Protection
Application and infrastructure security
- TLS
- Cryptography
- Encryption
- OWASP
- Secrets Management
- Database Secrets
- Threat Modeling
- Threat Detection
- DDoS Protection
- WAF
- SAST vs DAST
- Dependency Vulnerability Checks
Phase 8: Observability and Operations
Goal: Detect problems, understand system behavior, and operate services reliably.
- Telemetry
- Distributed Tracing
- Log Aggregation
- Prometheus and Grafana
- Anomaly Detection
- Spring Boot Health Check
- Auto Restart
- Kubernetes Pod Restart
- Cron Jobs
- Retry Mechanism
Phase 9: DevOps, Cloud, and Deployment
Goal: Package, deploy, scale, and manage applications in production.
Containers and Kubernetes
- Creating a Docker Image
- Kubernetes ConfigMap
- Kubernetes Ingress
- Persistent Volumes
- Kubernetes Pods Restart
- Helm
Deployment and infrastructure
- Deployment Strategy
- Multi-Region Deployment
- Serverful vs Serverless
- Serverless Cost Patterns
- Spot and Preemptible Instances
Phase 10: Architecture Patterns and Application Design
Goal: Compare common architecture styles and select the right pattern for a system.
- Monolith vs Microservices
- API Gateway
- System Design Patterns
- Two-Tier Architecture
- Project Architecture
- Asynchronous Decoupling
- Retry Mechanism
- Rate Limiting
- Rule Engine
- ACL and Rule Engine
Phase 11: Search, Analytics, and Data Processing
Goal: Learn the building blocks behind search, analytics, recommendations, and large-scale data processing.
- Inverted Index
- Text Search Engines
- Apache Lucene
- Elasticsearch
- TF-IDF
- Batch vs Streaming
- Micro-Batching
- Apache Spark
- DASH
- Chunker Service
- Basics of AI
Phase 12: Media and Streaming Systems
Goal: Understand how large media files are uploaded, processed, delivered, and streamed.
- Adaptive Streaming
- Adaptive Bitrate Streaming
- HLS
- Manifest Video Processing
- Transcoding
- Video Download and Upload
Phase 13: Real-World System Design Problems
Goal: Apply the concepts from the earlier phases to complete system designs.
When practicing a design problem, follow this sequence:
- Clarify the requirements.
- Identify functional requirements.
- Identify non-functional requirements.
- Estimate traffic and storage.
- Define the public APIs.
- Design the data model.
- Draw the high-level architecture.
- Explain the request and data flows.
- Identify bottlenecks and failure modes.
- Add scaling, caching, observability, and security.
- Discuss tradeoffs and alternative designs.
Suggested study schedule
Week 1: Fundamentals
Read Phase 1 and complete a simple single-server design.
Week 2: Capacity and scaling
Read Phase 2 and practice traffic, storage, and CPU calculations.
Weeks 3 and 4: Databases
Read Phase 3. Design a storage model and compare SQL, NoSQL, partitioning, sharding, and replication.
Week 5: Caching and performance
Read Phase 4. Add caching, rate limiting, backpressure, and latency targets to an existing design.
Week 6: Distributed systems
Read Phase 5. Study consensus, event delivery, failure handling, and consistency tradeoffs.
Week 7: Networking
Read Phase 6. Trace a request from the client through DNS, the load balancer, the gateway, services, and storage.
Week 8: Security and operations
Read Phases 7 and 8. Add authentication, authorization, secrets, logs, metrics, and tracing to your designs.
Week 9: DevOps and architecture patterns
Read Phases 9 and 10. Practice deployment, multi-region architecture, containers, and service boundaries.
Week 10: Search, media, and real-world problems
Read Phases 11, 12, and 13. Complete at least three full system design exercises.
Final checklist
Before considering a design complete, verify that it includes:
- Clear functional and non-functional requirements
- Capacity estimates
- API and data model decisions
- Appropriate storage technology
- Caching and performance strategy
- Scaling and partitioning strategy
- Failure handling and recovery plan
- Security and access control
- Observability and operational readiness
- Deployment and rollback strategy
- Tradeoffs and known limitations
After completing this roadmap, you should be able to reason about scalable systems, explain design tradeoffs, and approach system design interviews with a repeatable process.