System Design · Workspace
Overview
267 lessons in 21 modules, 34 free.
Part 1Fundamentals
01System design fundamentals14 lessons
- Introduction to system design
- Request lifecycle: what happens when you open a website
- Server concurrency: handling many requests at once
- Latency and throughput: measuring speed and capacity
- Functional and non-functional requirements
- Capacity estimation: users, storage and traffic
- Core system properties: availability, durability, consistency
- Design tradeoffs: making and explaining decisions
- Vertical and horizontal scaling: when to use each
- Stateless and stateful services: impact on scaling
- Monoliths and microservices: choosing an architecture
- Cost-aware design: avoiding unnecessary infrastructure
- Design: a URL shortener on a single server
- Lab: load testing a single server
02Networking, APIs and load balancing14 lessons
- TCP and UDP: reliable vs low-latency delivery
- DNS: how domain names resolve to IP addresses
- HTTP and HTTPS: how clients and servers communicate
- HTTP/2 and HTTP/3: faster, multiplexed connections
- REST API design: resources, methods and status codes
- API versioning: changing APIs without breaking clients
- Pagination: offset vs cursor-based
- gRPC: high-performance calls between services
- GraphQL: clients requesting exactly the data they need
- Synchronous and asynchronous service communication
- Load balancers: distributing traffic across servers
- API gateways and load balancers: roles compared
- Sticky routing with consistent hashing
- Design: a food delivery API
03Authentication, authorization and security12 lessons
- Authentication vs authorization: identity vs permissions
- Password storage: hashing and salting
- Sessions and cookies: keeping users logged in
- JWT: stateless authentication tokens
- OAuth 2.0 and OpenID Connect: third-party login
- Service authentication: API keys and mTLS
- Access control models: RBAC and ABAC
- Encryption in transit and at rest
- Secrets management: keeping credentials out of code
- Web security: SQL injection, XSS and CSRF
- Multi-tenancy: isolating customer data
- Design: login and single sign-on
Part 2Data and storage
04SQL databases: modeling, indexing and transactions14 lessons
- Relational data modeling: tables and relationships
- Evolvable data models: designing for future features
- Repository pattern: separating data access from logic
- Indexes: speeding up queries without full scans
- B-trees: the data structure behind most indexes
- Query plans: how the database executes SQL
- Transactions and ACID guarantees
- Isolation levels and locking: handling concurrent writes
- MVCC: letting reads and writes run at the same time
- Write-ahead logging: recovering after a crash
- Schema migrations without downtime
- Online index builds on live tables
- Soft delete: marking rows as deleted instead of removing them
- Design: a key-value store built on SQL
05Database scaling: read replicas, sharding and partitioning12 lessons
- Scaling a relational database: the options
- Read replicas and replication lag
- Connection pooling: reusing database connections
- Sharding: splitting data across databases
- Hot partitions: uneven load across shards
- Consistent hashing: adding servers without moving most data
- Resharding: rebalancing data without downtime
- Distributed ID generation: unique IDs across machines
- UUID vs Snowflake IDs: choosing an ID format
- Ticket servers: generating IDs from a central counter
- Clock skew: why server clocks disagree
- Design: a URL shortener for millions of users
06NoSQL databases and when to use them11 lessons
- SQL vs NoSQL: choosing a data store
- Document and key-value databases compared
- Columnar and wide-column databases compared
- Graph databases: when relationships are the data
- Time-series databases: storing metrics and events
- Distributed hash tables: decentralized key lookup
- Bloom filters: quickly checking whether an item exists
- Data tiering: moving old data to cheaper storage
- Object storage vs databases: where files belong
- Polyglot persistence: using multiple databases together
- Case: how Discord scaled message storage
07Caching and CDNs12 lessons
- Cache placement: from browser to database
- Caching patterns: cache-aside, write-through and write-back
- Eviction policies: LRU, LFU and more
- TTLs: expiring cached data
- Cache invalidation: keeping cached data correct
- Distributed caching: sharing a cache across servers
- Cache stampede: many requests hitting the database at once
- Hot keys: handling one extremely popular item
- Cache race conditions: concurrent reads and writes
- Cache failures and database fallback
- CDNs: caching content close to users
- Design: a fast product catalog page
08Storage engines and on-disk data structures15 lessons
- Storage engine requirements: what they must handle
- Storage engine tradeoffs: reads, writes and space
- Building a key-value store on a single file
- Binary file formats: designing your own
- Append-only logs and Bitcask
- LSM trees: storage designed for fast writes
- The LSM write path: memtable, WAL and SSTables
- The LSM read path: Bloom filters and sparse indexes
- Compaction: merging files and reducing amplification
- Immutable data files and versioning
- Object storage internals: how S3-style systems work
- Object placement: partitioning and metadata
- Append-only streams as a storage layer
- Durability: replication and checksums
- Design: an S3-style object store
Part 3Distributed systems
09Distributed systems: replication and consistency13 lessons
- Distributed systems: why they are hard
- Network partitions: when nodes cannot communicate
- Logical clocks: ordering events across machines
- Replication models: single-leader, multi-leader, leaderless
- Consistency models: from strong to eventual
- Read-your-writes consistency: always seeing your own updates
- CAP and PACELC: core distributed tradeoffs
- Quorums: how many replicas must agree
- CRDTs: merging concurrent edits without conflicts
- Gossip protocols: sharing state between nodes
- Failure detection: telling slow nodes from dead ones
- Service and node discovery in a cluster
- Case: lessons from Amazon’s Dynamo paper
10Consensus, coordination and distributed transactions12 lessons
- Consensus: getting nodes to agree on a value
- Raft: a consensus algorithm step by step
- Leader election: choosing a single coordinator
- Distributed locks and leases
- Fencing tokens: protecting against stale lock holders
- ZooKeeper and etcd: coordination services
- Two-phase commit: atomic transactions across services
- Sagas: multi-step transactions with rollback steps
- Transactional outbox: reliably publishing events
- Change data capture: streaming database changes
- Flash sales: preventing overselling of limited stock
- Design: a concert ticket booking system
11Queues, background jobs and event streams15 lessons
- Asynchronous processing: moving work off the request path
- Job queues vs event streams
- Delivery guarantees: at-most-once, at-least-once, exactly-once
- Event schemas: evolving events without breaking consumers
- Pub/sub: delivering one event to many consumers
- Postgres as a job queue: SKIP LOCKED
- Queue lag: detecting and handling backlogs
- Dead-letter queues: isolating failing messages
- Kafka: partitions and consumer groups
- Stream processing: computing over live data
- Event sourcing and CQRS
- Distributed job scheduling
- Workflow orchestration: multi-step jobs as DAGs
- Design: a notification service
- Design: a durable event log like Kafka
Part 4Production and reliability
12Reliability, overload and traffic spikes13 lessons
- Idempotency: making retries safe
- Exponential backoff and jitter
- Circuit breakers and bulkheads: containing failures
- Batching: combining requests for efficiency
- Backpressure: slowing down upstream producers
- Load shedding: rejecting work to stay available
- Tail latency: why p99 matters
- Graceful degradation: keeping core features working during failures
- Rate limiter placement: where and what to limit
- Rate limiting algorithms: token bucket to sliding window
- Abuse prevention: bots, spam and fraud
- Case: Stripe’s approach to safe payment retries
- Design: an API rate limiter
13Observability, incidents and safe deployments15 lessons
- Observability: logs, metrics and traces
- RED and USE methods: choosing what to measure
- SLOs and error budgets: defining reliability targets
- Alerting: signals worth paging for
- Incident response: from detection to resolution
- Post-mortems: learning from failures
- Deployment strategies: canary and blue-green
- Feature flags: separating deploy from release
- Database migrations: avoiding downtime and data loss
- Strangler pattern: moving reads off a monolith
- Backups and restore testing
- Data retention and user data deletion
- Case: GitLab’s 2017 database outage
- Design: monitoring and SLOs for a service
- Design: migrating a production database
14Multi-region systems and disaster recovery8 lessons
Part 5Specialised product systems
15Search: indexing, ranking and retrieval15 lessons
- Search system architecture: an overview
- Inverted indexes: mapping words to documents
- Boolean retrieval and tiered indexes
- TF-IDF: scoring how relevant a word is to a document
- BM25: the standard formula for ranking search results
- Query optimization: stop words and champion lists
- Query understanding: interpreting user intent
- Click signals: improving ranking with user feedback
- Search quality metrics: precision, recall and NDCG
- Index synchronization: keeping search in sync with the database
- Sharding a search index
- Vector and hybrid search: retrieving by meaning
- Design: search autocomplete
- Design: spelling correction (“Did you mean?”)
- Design: related and recent searches
16Analytics and counting at scale14 lessons
- Large-scale counting: why it gets hard
- View counting: accuracy vs speed
- Impression counting for ads
- Raw events vs pre-aggregated metrics
- Time-window aggregation: per-minute, hourly and daily counts
- HyperLogLog: estimating unique counts with little memory
- Count-min sketch: approximate frequency counts
- Top-k: finding the most frequent items
- Reservoir sampling: unbiased samples from a stream
- t-digest: accurate percentiles with little memory
- Streaming percentiles: p95 and p99 in real time
- Mergeable sketches: combining results across servers
- OLTP vs OLAP: transactional vs analytical workloads
- Design: an ad click aggregator
17Realtime systems, chat and social feeds14 lessons
- WebSockets, SSE and long polling compared
- Scaling WebSocket connections to millions
- Presence: tracking online status
- Data modeling for social networks
- Follow graphs: storing relationships at scale
- Feed generation: fan-out on write vs on read
- Hashtags: extracting and indexing tags
- Reactions and likes: data modeling
- Design: live reactions on a video stream
- Design: unread message indicators
- Design: live sports commentary
- Design: tagging people in photos
- Design: a chat app like WhatsApp
- Design: a social media news feed
18Location, maps and matching systems10 lessons
- Proximity search: finding nearby places
- Geohash: encoding locations as short strings
- Spatial grids: geohash, S2 and H3 compared
- Redis geospatial queries for low latency
- Geofencing: checking if a point is inside a region
- Real-time location tracking
- Deduplication: filtering already-seen items
- Matching algorithms: pairing riders, drivers and items
- Design: a nearby restaurants service
- Design: ride matching like Uber
19Media uploads, streaming and file sync13 lessons
- Direct uploads to object storage
- Large file uploads: signed URLs and multipart
- Image processing: resizing and CDN delivery
- Profile image service: storage and delivery
- Video transcoding: converting uploads into multiple formats
- Adaptive bitrate streaming: quality that adapts to the network
- Video security: signed URLs and DRM
- Live streaming: protocols and latency
- File synchronization: keeping devices in sync
- Chunking and deduplication: syncing only changed data
- File versioning and metadata
- Design: a video platform like YouTube
- Design: a file sync service like Dropbox
Part 6Design practice and interviews
20End-to-end design problems10 lessons
- Case: how Instagram scaled with a tiny team
- Design: a photo-sharing app like Instagram
- Design: a payment processing system
- Design: collaborative editing like Google Docs
- Design: a recommendation engine
- Design: in-app search for a large product
- Design: a web crawler
- Design: an e-commerce checkout
- Design: a distributed key-value store
- Design: a real-time game leaderboard
21System design interviews11 lessons
- How design interviews are evaluated
- A 45-minute interview framework
- Clarifying requirements in an interview
- Estimation under time pressure
- Presenting the high-level design
- Deep dives and tradeoff discussions
- Handling follow-up questions and pushback
- Common interview mistakes
- Mock interview: URL shortener
- Mock interview: chat application
- Self-review: scoring your own answer