Learning Paths
System Design Interview Roadmap
Decoding the Secrets of Successful System Design Interviews.
This guide is a comprehensive resource that prepares budding software engineers for the challenges of system design interviews. It delves into the intricacies of designing robust, scalable, and efficient systems, mirroring real-world scenarios that are commonly encountered during technical interviews. With a balanced mix of theoretical knowledge and practical exercises, including case studies, this guide ensures a comprehensive understanding of system design principles.
Modules:
5

Annual Subscription
Get instant access to all current and upcoming courses for one year.
OR
Lifetime Access - This Bundle
Get lifetime access to this bundle only.
Discounted Prices for Your Region
Certification on completing the course.
Learning Objectives
Comprehensive Coverage: The guide provides an in-depth understanding of system design principles, covering all essential topics required for technical interviews.
Real-World Scenarios: The guide includes real-world case studies and scenarios to help you understand what to expect and how to handle various situations during an interview.
Expert Guidance: Learn from industry professionals who have been on both sides of the interview table and can provide valuable insights and tips.
Flexibility: Learn at your own pace with this online guide, which you can access anytime, anywhere.
Community Support: Join a community of like-minded learners, share your doubts, discuss ideas, and learn together.
Career Advancement: This guide could be a stepping stone towards landing your dream job in the tech industry.
Path Contents
• 76 Chapters • 669 Lessons
Grokking System Design Fundamentals: Course for Beginners
Learn the core building blocks of scalable systems (load balancing, caching, databases, APIs) in a beginner-friendly, text-based course. From the creators of Grokking the System Design Interview.
• 27 Chapters • 171 Lessons
Hide Contents
2.
Key Characteristics of Distributed Systems
9 lessons
Scalability
Understand scalability in system design, covering vertical and horizontal scaling, stateless servers, caching, replication, sharding, and bottlenecks.
Availability
Understand availability in system design, covering the nines, single points of failure, redundancy, failover, MTBF and MTTR, and SLIs, SLOs, and SLAs.
Latency and Performance
Understand latency and throughput in system design, covering where the time goes, p95 and p99 percentiles, caching, data locality, and load balancing.
Concurrency and Coordination
Understand concurrency in distributed systems, covering race conditions, locking, optimistic concurrency control, synchronization, and consistency models.
Monitoring and Observability
Understand monitoring and observability, covering metrics, structured logging, distributed tracing, alerting, anomaly detection, and dashboards.
Resilience and Error Handling
Understand resilience in system design, covering cascading failures, timeouts, retries with backoff, circuit breakers, bulkheads, and degradation.
Fault Tolerance vs. High Availability
Compare fault tolerance and high availability, covering their promises on downtime and data loss, the techniques each uses, and when to choose one.
Flashcards Review
Review the key terms of distributed systems with flashcards on scalability, availability, latency, concurrency, observability, and resilience.
Chapter Assessment
Test what you learned about distributed systems with questions on scalability, availability, latency, concurrency, observability, and resilience.
3.
Back-of-the-Envelope Estimation
6 lessons
What Is Back-of-the-Envelope Estimation
Understand what back-of-the-envelope estimation is for, the three rules that keep it fast, how accurate it must be, and where it belongs in an interview.
Numbers You Should Know
Learn the handful of numbers every estimate is built from: how big data is, how long common operations take, and how many seconds are in a day or a month.
Estimating QPS, Storage, and Bandwidth
Learn to estimate traffic, storage, and bandwidth from a user count, add the cache calculation, and work through the four of them in the right order.
A Worked Estimation Example
Follow a full estimation for a photo sharing service, from stated assumptions to traffic, storage, bandwidth, and cache, and see what each number decides.
Flashcards Review
Review the key ideas of back-of-the-envelope estimation with flashcards on the core numbers and the traffic, storage, bandwidth, and cache calculations.
Chapter Assessment
Test your understanding of back-of-the-envelope estimation: the core numbers, the four standard calculations, and how to state your assumptions.
4.
Network Essentials
7 lessons
HTTP vs. HTTPS
Understand how HTTP works, what HTTPS adds with TLS, how certificates stop man-in-the-middle attacks, and what encryption still does not hide.
TCP vs. UDP
Compare TCP and UDP, covering the three-way handshake, reliable ordered delivery, congestion control, head-of-line blocking, and when each one fits.
HTTP: 1.0 vs. 1.1 vs 2.0 vs. 3.0
Compare HTTP/1.0, 1.1, 2, and 3, covering persistent connections, multiplexing, header compression, head-of-line blocking, and QUIC over UDP.
URL vs. URI vs. URN
Understand how URIs, URLs, and URNs relate, the parts of a URL, absolute and relative forms, and what each one means for caching and stored identifiers.
What Happens When You Type a URL into the Browser
Follow one request end to end: URL parsing, DNS, the TCP and TLS handshakes, the CDN edge, the origin and its cache, and where the time goes.
Flashcards Review
Review the key ideas of network essentials with flashcards on HTTP versions, HTTPS and TLS, TCP and UDP, URLs, and the path of a single request.
Chapter Assessment
Test your understanding of network essentials: HTTP and HTTPS, TCP and UDP, the HTTP versions, URLs and URNs, and the path one request takes.
5.
Long-Polling vs. WebSockets vs. Server-Sent Events
7 lessons
Introduction to Real-Time Communication
Understand why a plain HTTP request cannot push updates, how polling fills the gap, and why polling stops scaling as users and update rates grow.
What is Long-Polling?
Understand how long-polling holds a request open until the server has data, what it costs in connections, and where this technique still fits.
What is WebSocket?
Understand how the WebSocket handshake turns one HTTP connection into a two-way channel, what it costs the server, and where WebSockets fit best.
What are Server-Sent Events?
Understand how Server-Sent Events stream one-way updates over a long-lived HTTP connection, their strengths and limits, and where they fit.
Difference Between Long-Polling, WebSockets, and Server-Sent Events
Compare long-polling, WebSockets, and Server-Sent Events side by side, learn how to choose between them, and how to explain that choice clearly.
Flashcards Review
Review the key ideas of real-time communication with flashcards on polling, long-polling, WebSockets, Server-Sent Events, and choosing between them.
Chapter Assessment
Test your understanding of real-time communication: why HTTP cannot push updates, polling, long-polling, WebSockets, and Server-Sent Events.
6.
Domain Name System (DNS)
5 lessons
Introduction to DNS
Understand what DNS does, how to read a domain name, the root, TLD, and authoritative levels, the common record types, and the kinds of resolvers.
DNS Resolution Process
Understand how a name resolves through recursive and iterative queries, how caching and TTL shape the answer, and how to change an IP address safely.
DNS Load Balancing and High Availability
Understand how DNS spreads load with round-robin, health-checked, weighted, and location-based answers, plus anycast routing and where it stops.
Flashcards Review
Review the key ideas of DNS with flashcards on the name hierarchy, record types, resolvers, recursive and iterative queries, caching, TTL, and anycast.
Chapter Assessment
Test your understanding of DNS: the name hierarchy, record types and TTL, recursive and iterative resolution, caching, and DNS load balancing.
7.
Proxies
5 lessons
What is a Proxy Server?
Understand what a proxy server does, how forward and reverse proxies differ, what each one hides, and which jobs each of them is used for.
Uses of Proxies
Learn the ten common jobs a proxy does, grouped into making traffic faster, making it safer, and keeping control of what passes through it.
VPN vs. Proxy Server
Compare a VPN and a proxy server on encryption, scope, and trust, learn the five differences between them, and know which one to reach for.
Flashcards Review
Review the key ideas of proxies with flashcards on forward and reverse proxies, caching, collapsed forwarding, the common uses, and VPNs.
Chapter Assessment
Test your understanding of proxies: forward and reverse proxies, what each one hides, caching, collapsed forwarding, the common uses, and VPNs.
8.
Load Balancing
10 lessons
Introduction to Load Balancing
Understand what a load balancer does, how it picks a server, plus health checks, session persistence, TLS termination, and where to place one.
Load Balancing Algorithms
Compare nine load balancing algorithms, from round robin and least connections to IP hash and least response time, and learn how to choose one.
Uses of Load Balancing
Learn the five main uses of load balancing: high availability, horizontal scaling, zero-downtime deployments, attack mitigation, and SSL termination.
Load Balancer Types
Compare the types of load balancer: hardware, software, cloud, DNS, global server load balancing, hybrid, and the Layer 4 and Layer 7 split.
Stateless vs. Stateful Load Balancing
Compare stateless and stateful load balancing, how each one treats a client session, and what each approach costs in memory and flexibility.
High Availability and Fault Tolerance
Learn how to stop a load balancer from becoming a single point of failure, using redundancy, failover strategies, health checks, and shared state.
Scalability and Performance
Learn how to scale load balancers horizontally and vertically, manage connection and request rate limits, and limit their effect on latency.
Challenges of Load Balancers
Learn the seven common problems with load balancers: single points of failure, configuration, scaling limits, latency, sticky sessions, and cost.
Flashcards Review
Review the key ideas of load balancing with flashcards on the algorithms, health checks, load balancer types, the OSI layers, and sticky sessions.
Chapter Assessment
Test your understanding of load balancing: where a balancer sits, the algorithms, the types and OSI layers, stateless routing, and failover.
9.
API Gateway
5 lessons
Introduction to API Gateway
Understand what an API gateway does, why systems use one, how a request flows through it, how it differs from a load balancer, and what it costs.
Usage of API gateway
Learn the twenty jobs an API gateway does, grouped into routing requests, reshaping them, protecting the backend, and running an API as a business.
Advantages and disadvantages of using API gateway
Weigh the advantages and disadvantages of an API gateway, read its latency cost honestly, and decide when one is worth adding to a system.
Flashcards Review
Review the key ideas of API gateways with flashcards on routing, authentication, rate limiting, request reshaping, and gateway versus load balancer.
Chapter Assessment
Test your understanding of API gateways: what one does, how a request flows through it, its common jobs, and how it differs from a load balancer.
10.
Rate Limiting and Throttling
6 lessons
What Is Rate Limiting
Understand what rate limiting caps, who counts as one client, how throttling relates to it, why systems need it, and what a limited client sees.
Rate Limiting Algorithms
Compare the token bucket, leaky bucket, fixed window, sliding window log, and sliding window counter, and see how each one handles a burst.
Distributed Rate Limiting
Understand why a limit multiplies across servers, how a shared counter fixes it, the race that lets extra requests through, and cheaper approximations.
Rate Limiting in Practice
Learn where the limiter should sit, what to tell a rejected client, how clients should retry, and how to choose the number behind a limit.
Flashcards Review
Review the key ideas of rate limiting with flashcards on the five counting algorithms, bursts, distributed counters, and what a rejected client sees.
Chapter Assessment
Test your understanding of rate limiting: what a limit is made of, the five algorithms and bursts, distributed counters, and what to tell a client.
11.
Caching
11 lessons
Introduction to Caching
Understand what a cache is, how hits and misses work, what eviction and staleness mean, where caches live in a system, and what caching costs.
Why is Caching Important?
Learn why caching matters: lower latency, better performance, less network load, higher scalability, and a smoother experience for users.
Types of Caching
Compare the types of caching, from in-memory, disk, and database caches to client-side, server-side, CDN, and DNS caching, and where each belongs.
Cache Replacement Policies
Compare the cache replacement policies that decide what to evict when a cache fills up: least recently used, least frequently used, FIFO, and random.
Cache Invalidation
Learn why invalidation matters, the write-through, write-around, write-back, and write-behind strategies, and methods like purge, ban, and TTL.
Cache Read Strategies
Compare the read-through and read-aside cache strategies, covering which component fetches data on a miss and what each one asks of your code.
Cache Coherence and Consistency Models
Understand cache coherence across many caches, and the consistency models that decide how quickly every copy of the data sees an update.
Caching Challenges
Learn the six common cache problems and their fixes: thundering herd, cache penetration, big keys, hot keys, cache pollution, and cache drift.
Cache Performance Metrics
Learn the metrics that show whether a cache is earning its place: hit rate, miss rate, cache size, and cache latency, and how to read them.
Flashcards Review
Review the key ideas of caching with flashcards on hits and misses, replacement policies, write strategies, invalidation, and the common problems.
Chapter Assessment
Test your understanding of caching: hits and misses, the caching types, replacement policies, write and read strategies, invalidation, and metrics.
12.
CDN
6 lessons
What is CDN?
Understand what a CDN is, how points of presence, edge servers, and the origin fit together, how a request is served, and what to put on a CDN.
Origin Server vs. Edge Server
Compare the origin server with an edge server, what each one stores and does, and how the two work together to serve a single request.
CDN Architecture
Understand where CDN servers sit, how anycast, DNS, and GeoIP routing find an edge server, how cached copies stay fresh, and the network topologies.
Push CDN vs. Pull CDN
Compare pull and push CDNs on who moves the content to the edge servers and when, and learn which model suits which kind of site.
Flashcards Review
Review the key ideas of CDNs with flashcards on points of presence, edge servers, the origin, request routing, TTL and purging, and push versus pull.
Chapter Assessment
Test your understanding of CDNs: points of presence and edge servers, how a request reaches the nearest edge, keeping copies fresh, and push versus pull.
13.
Data Partitioning
7 lessons
Introduction to Data Partitioning
Understand what data partitioning is, the terms behind it, and why splitting a large dataset into smaller independent partitions makes it manageable.
Partitioning Methods
Compare the three partitioning schemes, horizontal, vertical, and hybrid, and learn what each one splits and when large applications reach for it.
Data Sharding Techniques
Compare six sharding techniques: range-based, hash-based, directory-based, geographical, dynamic, and hybrid, and see why none of them is SQL-only.
Benefits of Data Partitioning
Learn the ten benefits of data partitioning, from faster queries and scalability to load balancing, parallel processing, and faster recovery.
Common Problems Associated with Data Partitioning
Learn the seven problems partitioning brings: complexity, data skew, key selection, cross-partition queries, migration, maintenance, and cost.
Flashcards Review
Review the key ideas of data partitioning with flashcards on horizontal and vertical splits, the sharding techniques, partition keys, and data skew.
Chapter Assessment
Test your understanding of data partitioning: the partitioning methods, the sharding techniques, choosing a key, data skew, and cross-partition queries.
14.
Redundancy and Replication
6 lessons
What is Redundancy?
Understand what redundancy is, how it removes a single point of failure, what it buys in reliability and recovery, and what it costs to run.
What is Replication?
Understand what database replication is, how it differs from redundancy, and compare synchronous, asynchronous, and semi-synchronous replication.
Replication Methods
Compare seven replication arrangements, from single-leader and multi-leader to leaderless quorums, chain, read-replica, snapshot, and hybrid.
Data Backup vs. Disaster Recovery
Understand why replication is not a backup, how data backup and disaster recovery differ, and how all three ideas fit together in one plan.
Flashcards Review
Review the key ideas of redundancy and replication with flashcards on single points of failure, the replication modes, leaders, and backups.
Chapter Assessment
Test your understanding of redundancy and replication: single points of failure, the replication modes and methods, and backup versus disaster recovery.
15.
CAP & PACELC Theorems
8 lessons
Introduction to CAP Theorem
Understand what the CAP theorem claims, where the choice is actually made, why partitions are not optional, and how familiar products reflect it.
Components of CAP Theorem
Understand consistency, availability, and partition tolerance in their strict technical sense, and why the C in CAP is not the C in ACID.
Trade-offs in CAP Theorem
Understand why no system gets all three guarantees, walk through the impossible case, and compare the CP, AP, and CA categories.
Examples of CAP Theorem in Practice
See how MongoDB, Cassandra, ZooKeeper, and DynamoDB land on either side of the CAP choice, and what each one does when the network splits.
Beyond CAP Theorem
Understand what CAP leaves out, how PACELC adds latency to the picture, and how CRDTs and per-operation choices soften the trade-off.
System Design Trade-offs in Interviews
Learn five moves for handling a consistency trade-off, from asking the deciding question to naming what the choice costs and offering a mixed approach.
Flashcards Review
Review the key ideas of CAP and PACELC with flashcards on the three properties, the CP and AP categories, real systems, and the latency trade-off.
Chapter Assessment
Test your understanding of CAP and PACELC: the three properties, why partitions are a given, the CP and AP categories, and real system examples.
16.
Databases (SQL vs. NoSQL)
12 lessons
Introduction to Databases
Understand what a database and a DBMS are, and the five differences between relational and non-relational systems that matter from the start.
SQL Databases
Understand how relational databases model data in tables with primary and foreign keys, what SQL does, the main engines, and where this model strains.
NoSQL Databases
Understand the six types of NoSQL database, the four you will be asked about, what you gain and give up, and when this model actually fits.
SQL vs. NoSQL
Compare SQL and NoSQL on data model and schema, scalability, consistency and transactions, query complexity, performance, and operational cost.
ACID vs BASE Properties
Understand the four ACID promises and the three BASE properties, why the C in ACID differs from the C in CAP, and how to choose between them.
Real-World Examples and Case Studies
See where SQL won, where NoSQL won, and where systems used both, and learn what the pattern across those choices tells you about your own.
SQL Normalization and Denormalization
Understand how normalization splits data to remove duplication, how denormalization brings it back for cheap reads, and the trade between them.
In-Memory Database vs. On-Disk Database
Compare in-memory and on-disk databases on speed, durability, and cost, and learn which kinds of workload belong in each one.
Data Replication vs. Data Mirroring
Compare data replication with data mirroring, learn the five differences between them, and see why many systems end up using both.
Database Federation
Understand how database federation presents several independent databases as one, how a federated query actually runs, and what it suits.
Flashcards Review
Review the key ideas of databases with flashcards on tables and keys, the NoSQL types, ACID and BASE, normalization, and federation.
Chapter Assessment
Test your understanding of databases: the relational model, the NoSQL types, SQL versus NoSQL, ACID and BASE, normalization, and federation.
17.
Indexes
7 lessons
What are Indexes?
Understand what an index stores, how it replaces a full table scan, why selectivity decides whether it helps, and what it costs in writes.
How a B-Tree Index Works
Understand the shape of a B-tree, why it stays three or four levels deep, how it serves point and range reads, and what an insert really costs.
Types of Indexes
Compare eleven index types, from primary, unique, and clustered to composite, covering, partial, bitmap, full-text, hash, and geospatial.
B-Tree vs. LSM Tree
Compare B-trees and LSM trees on updating in place versus appending, read cost, compaction, the three amplifications, and how to choose.
Indexes in Distributed Systems
Understand what sharding takes away, how local and global secondary indexes differ, what scatter-gather costs, and the traps in global indexes.
Flashcards Review
Review the key ideas of indexes with flashcards on selectivity and table scans, B-trees and LSM trees, the index types, and sharded indexes.
Chapter Assessment
Test your understanding of indexes: selectivity and table scans, how a B-tree stays shallow, page splits, the index types, and sharded indexes.
18.
Bloom Filters
6 lessons
Introduction to Bloom Filters
Understand how a bit array and several hash functions answer set membership, why a wrong no is impossible, and how to size a filter properly.
Benefits & Limitations of Bloom Filters
Weigh the five benefits of a Bloom filter, from tiny memory to constant-time checks, against the five limits, including false positives.
Variants and Extensions of Bloom Filters
Compare the Bloom filter variants, counting, compressed, spectral, scalable, and cuckoo, and learn what each one pays for the limit it removes.
Applications of Bloom Filters
See the five main uses of Bloom filters, from skipping disk reads to spam checks, and learn the single pattern behind all of them.
Flashcards Review
Review the key ideas of Bloom filters with flashcards on bit arrays and hash functions, false positives, sizing, the variants, and the uses.
Chapter Assessment
Test your understanding of Bloom filters: bit arrays and hash functions, false positives versus false negatives, sizing, and the variants.
19.
Quorum
4 lessons
Why Quorum?
Understand why systems keep replicas, the new problem replication creates when copies disagree, and what a system needs to settle on one answer.
What is Quorum?
Understand how a quorum settles an operation, how to size it, why an odd node count helps, the R + W > N rule, and how to tune it to a workload.
Flashcards Review
Review the key ideas of quorum with flashcards on replicas, quorum size, odd node counts, the R + W > N rule, and tuning reads and writes.
Chapter Assessment
Test your understanding of quorum: why replicas disagree, quorum size, odd node counts, the R + W > N rule, and tuning reads and writes.
20.
Leader and Follower
3 lessons
What is Leader and Follower Pattern?
Understand how one leader coordinates its followers, what happens when the leader fails, and the strengths, weaknesses, and uses of the pattern.
Flashcards Review
Review the leader and follower pattern with flashcards on the leader's job, replication to followers, failover and elections, and the pattern's limits.
Chapter Assessment
Test your understanding of the leader and follower pattern: the leader's job, replication to followers, failover, and where the pattern falls short.
21.
Heartbeat
3 lessons
What is Heartbeat?
Understand how heartbeat messages detect a failed server, how to pick the interval and the timeout, and why one missed beat is not proof of failure.
Flashcards Review
Review the key ideas of heartbeats with flashcards on failure detection, the timeout rule, picking an interval, and false suspicion of a server.
Chapter Assessment
Test your understanding of heartbeats: why failure detection matters, the timeout rule, picking the interval, and why a missed beat is not proof.
22.
Checksum
4 lessons
What is Checksum?
Understand what a checksum is, how it is computed and verified, how it catches a single flipped bit, and what it cannot protect against.
Uses of Checksum
See where checksums are used, from network transfers and disk corruption to comparing replicas and verifying downloads, and where they do not fit.
Flashcards Review
Review the key ideas of checksums with flashcards on hash functions, verification, detecting corruption, comparing replicas, and the limits.
Chapter Assessment
Test your understanding of checksums: how one is computed and verified, what it detects, where it is used, and what it cannot protect against.
23.
Distributed Messaging System
8 lessons
Introduction to Messaging System
Understand why services stop talking directly, what a messaging system is, the queue and publish-subscribe models, and what a broker does.
Introduction to Kafka
Understand Kafka as a distributed commit log: its common terms, its high-level architecture, its use cases, and how the cluster tracks its own state.
Messaging patterns
Compare the five messaging patterns: point-to-point, publish-subscribe, request-reply, fan-out and fan-in, and the dead letter queue.
Popular Messaging Queue Systems
Meet the four messaging systems you will face most often, RabbitMQ, Kafka, Amazon SQS, and ActiveMQ, and learn how to think about the options.
RabbitMQ vs. Kafka vs. ActiveMQ
Compare RabbitMQ, Kafka, and ActiveMQ on the ideas they are built on, their key differences, and how to choose one of them for a system.
Scalability and Performance
Learn how a messaging system scales, through partitioning, consumer groups, parallel processing, and message batching and compression.
Flashcards Review
Review the key ideas of distributed messaging with flashcards on brokers, queues and publish-subscribe, the patterns, Kafka terms, and partitions.
Chapter Assessment
Test your understanding of distributed messaging: brokers, queues and publish-subscribe, the five patterns, Kafka, and scaling consumers.
24.
Distributed File Systems
5 lessons
What is a Distributed File System?
Understand how a distributed file system spreads files across machines while showing one folder tree, plus its common uses and its challenges.
Architecture of a Distributed File System
Understand how a read travels through a distributed file system, why metadata is kept apart from file data, and how HDFS puts it together.
Key Components of a DFS
Understand the three properties that shape a distributed file system: how it replicates blocks, how it scales, and what consistency it offers.
Flashcards Review
Review the key ideas of distributed file systems with flashcards on metadata servers, storage nodes, blocks, replication, and consistency.
Chapter Assessment
Test your understanding of distributed file systems: metadata servers and storage nodes, how a read travels, blocks, replication, and consistency.
25.
Security
9 lessons
What is Security and Privacy?
Understand how security and privacy differ, why distributed systems are harder to protect, and the defenses this chapter covers in detail.
What is Authentication?
Understand how authentication proves identity, the three kinds of proof, how a login works, and the common authentication methods and types.
What is Authorization?
Understand how authorization decides what an identified user may do, how roles and permissions work, and how a permission check runs.
Authentication vs. Authorization
Compare authentication and authorization, see the key differences in one example, and learn why the two gates are so easy to mix up.
OAuth vs. JWT for Authentication
Understand what OAuth grants and what a JWT carries, the key differences between a protocol and a token format, and how the two fit together.
What is Encryption?
Understand how encryption scrambles data, how symmetric and asymmetric keys differ, where encryption is used, and the challenges it brings.
What are DDoS Attacks?
Understand how a DDoS attack floods a service with fake traffic, the common types of attack, and the strategies that mitigate them.
Flashcards Review
Review the key ideas of security with flashcards on authentication and authorization, OAuth and JWT, encryption keys, and DDoS mitigation.
Chapter Assessment
Test your understanding of security: authentication and authorization, OAuth and JWT, symmetric and asymmetric encryption, and DDoS attacks.
26.
Misc Concepts
10 lessons
Batch Processing vs. Stream Processing
Compare batch and stream processing on when each one handles data, their key differences, and how to pick one for a given workload.
XML vs. JSON
Compare XML and JSON as data exchange formats, covering syntax, size, and readability, and learn which one suits which kind of interface.
Synchronous vs. Asynchronous Communication
Compare synchronous and asynchronous communication, what waiting for an answer costs a system, and how to decide for each hop in a request.
Push vs. Pull Notification Systems
Compare push and pull notification systems on who starts the conversation, the delay a user sees, and the load each model puts on servers.
Microservices vs. Serverless Architecture
Compare microservices and serverless architecture on who runs the code, how each one scales and is billed, and when each model is the better fit.
Message Queues vs. Service Bus
Compare a message queue with a service bus, see what a bus adds beyond carrying messages, and learn which middle piece a system needs.
Stateful vs. Stateless Architecture
Compare stateful and stateless architecture, see where the state goes once servers stop holding it, and learn what each choice costs.
Event-Driven vs. Polling Architecture
Compare event-driven and polling architecture on how one part learns that something changed, the delay each adds, and what each one costs.
Flashcards Review
Review this chapter with flashcards on all eight comparisons, from batch and stream processing to event-driven and polling architecture.
Chapter Assessment
Test your understanding of the eight comparisons: batch and stream, XML and JSON, sync and async, push and pull, and stateful and stateless.
Grokking the System Design Interview
The original system design interview course from DesignGurus. Master scalable systems, critical trade-offs, and 15+ real-world design problems with a repeatable interview framework.
• 4 Chapters • 82 Lessons
Hide Contents
1.
How to Approach a System Design Interview
7 lessons
What is a System Design Interview?
Understand the purpose of system design interviews, focusing on scalability, architecture decisions, trade-offs, and real-world problem-solving skills.
System Design Interviews - A step by step guide
Functional vs. Non-functional Requirements
Master functional vs. non-functional requirements in system design, emphasizing scalability, performance, and trade-offs for building robust, real-world systems.
What are Back-of-the-Envelope Estimations?
Master back-of-the-envelope estimation to assess scalability, performance, and trade-offs using quick calculations in system design interviews.
System Design Master Template
Things to Avoid During System Design Interview
Learn what to avoid in system design interviews, like skipping trade-offs, ignoring requirements, poor communication, and rigid thinking.
Quiz
2.
System Design Trade-offs
24 lessons
Importance of Discussing Trade-offs
Demonstrating trade-offs shows maturity, critical thinking, and real-world design skills crucial for scalable, practical system architecture.
Latency vs Throughput
Understand the difference between latency and throughput, and explore strategies to optimize response time and data processing capacity in systems.
Horizontal vs Vertical Scaling
Proxy vs. Reverse Proxy
Understand how proxies and reverse proxies manage client and server traffic in distributed system design to improve security, caching, and scalability.
CDN Usage vs Direct Server Serving
Learn when to use a Content Delivery Network vs direct server hosting based on traffic scale, geographic distribution, and caching efficiency.
Load Balancer vs. API Gateway
Understand differences between Load Balancer and API Gateway in scalable architectures—traffic distribution, request routing, API management, and availability.
API Gateway vs Direct Service Exposure
Explore API Gateway vs Direct Service Exposure in distributed systems—compare centralized routing and security with direct access and reduced latency.
Token Bucket vs Leaky Bucket
Learn how Token Bucket and Leaky Bucket algorithms manage network traffic shaping, rate limiting, and handling of bursty data.
Stateful vs Stateless Architecture
Explore the architecture of stateful vs stateless systems, comparing session handling, scalability, and design trade-offs for APIs and web services.
Serverless Architecture vs Traditional Server-based
Learn serverless system design benefits like dynamic scaling and reduced ops versus traditional server hosting with full control and overhead.
REST vs RPC
Learn the architectural differences between REST and RPC, including stateless resource handling vs. procedure calls, flexibility, scalability, and performance trade-offs.
Synchronous vs Asynchronous Communication
NewPush vs Pull Architecture
NewPolling vs. Long-Polling vs. WebSockets vs. Webhooks
Compare real-time delivery strategies; Polling, Long-Polling, WebSockets, and Webhooks, for scalable, event-driven system communication.
Batch Processing vs Stream Processing
Compare batch vs stream processing in system design; complexity, resource efficiency, continuous vs scheduled data flow, and real-time responsiveness.
SQL vs. NoSQL
Compare SQL vs NoSQL databases based on schema structure, scalability, ACID compliance, flexibility, and best use cases in system design.
Normalization vs Denormalization
NewACID vs BASE Properties in Databases
Understand key differences between ACID and BASE database models, balancing consistency, availability, scalability, and fault tolerance in distributed systems.
Strong vs Eventual Consistency
Explore consistency models in distributed systems, comparing strong and eventual consistency in terms of latency, availability, accuracy, and scalability trade-offs.
Primary-Replica vs Peer-to-Peer Replication
Understand Primary-Replica vs Peer-to-Peer replication models, including data flow, consistency, scalability, fault tolerance, and use cases.
Read Heavy vs Write Heavy System
Explore how system design varies for read-heavy and write-heavy workloads with techniques like batching, replication, and data partitioning.
Server-Side Caching vs Client-Side Caching
Understand server-side vs client-side caching, how they differ in location, control, performance impact, and best use across web apps.
Cache-Aside vs Read-Through, Write-Through vs Write-Back
Explore cache read and write strategies for improving read performance, data consistency, and integrity in scalable systems.
Quiz
3.
System Design Problems
31 lessons
Designing a URL Shortening Service like TinyURL
Quiz - Designing URL Shortner
Designing Pastebin
Quiz - Designing Pastebin
Designing Instagram
Quiz - Designing Instagram
Designing Dropbox
Quiz - Designing Dropbox
Designing Facebook Messenger
Quiz - Designing Facebook Messenger
Designing Twitter
Quiz - Designing Twitter
Designing Youtube or Netflix
Quiz - Designing Youtube or Netflix
Designing Typeahead Suggestion
Quiz - Designing Typeahead Suggestion
Designing an API Rate Limiter
Quiz - Designing an API Rate Limiter
Designing Twitter Search
Quiz - Designing Twitter Search
Designing a Web Crawler
Quiz - Designing a Web Crawler
Designing Facebook’s Newsfeed
Quiz - Designing Facebook’s Newsfeed
Designing Yelp or Nearby Friends
Quiz - Designing Yelp or Nearby Friends
Designing Uber backend
Quiz - Designing Uber backend
Designing Ticketmaster
Quiz - Designing Ticketmaster
Additional Resources
4.
Glossary of System Design Basics
20 lessons
System Design Basics
Get familiar with core system design concepts, key architectural components, and building blocks of scalable, distributed software systems.
Key Characteristics of Distributed Systems
Explore key characteristics of distributed systems, including scalability, reliability, availability, efficiency, fault tolerance, and manageability.
Load Balancing
Learn how load balancing improves scalability and availability by distributing traffic using smart algorithms, health checks, and redundancy techniques.
Load Balancing Algorithms
Proxies
Learn how forward and reverse proxies improve security, caching, and traffic control by mediating communication between clients and servers.
Caching
Learn caching strategies to improve system performance, including cache types, eviction policies, read/write methods, and cache invalidation techniques.
SQL vs. NoSQL
Compare relational and non-relational databases to understand schema flexibility, scalability, ACID compliance, and ideal use cases for each.
Indexes
Understand how database indexes optimize query performance, enable efficient lookups, and impact write operations in large-scale systems.
Data Partitioning
Learn data partitioning techniques, horizontal, vertical, hybrid, and partitioning criteria to scale databases, improve performance, and balance workloads.
Consistent Hashing
Learn the architecture of scalable systems using consistent hashing for efficient data partitioning, replication, and dynamic node management.
Redundancy and Replication
Learn how redundancy and replication improve system reliability and availability through failover strategies and synchronous, asynchronous, and semi-synchronous replication.
CAP Theorem
Understand why distributed systems must trade off between consistency, availability, and partition tolerance, only two of the three can be guaranteed at any time.
PACELC Theorem
Learn how PACELC extends CAP by showing that even without partitions, distributed systems must balance latency and consistency in replicated environments.
Quorum
Design highly available distributed systems using quorum-based consistency models to coordinate read/write operations across replicated nodes.
Leader and Follower
Understand the architecture of leader-based replication in distributed systems for consistent writes, fault tolerance, and coordinated data synchronization.
Heartbeat
Learn how distributed systems use heartbeat signals to detect server failures and maintain reliable request routing and availability.
Checksum
Explore how distributed systems ensure data integrity by using checksums to detect and prevent data corruption during transmission.
Bloom Filters
Explore space-efficient system design using Bloom filters for fast, probabilistic membership checks with minimal memory and no false negatives.
Long-Polling vs WebSockets vs Server-Sent Events
Understand the system design of real-time communication protocols for scalable push-based updates between client and server.
Quiz
Grokking the System Design Interview, Volume II
The advanced successor to the world's best-selling System Design course, designed to help experienced engineers master complex distributed systems and secure L5/L6 roles.
• 22 Chapters • 227 Lessons
Hide Contents
1.
Introduction
3 lessons
Who This Course Is For
Understand who this course is written for, what is inside it, what it deliberately leaves out, and what you should be able to do by the end.
How to Use This Course
Pick a reading plan for a week, a month, or no deadline, learn to attempt each case study first, and see what the quizzes are really for.
How Every Case Study Is Structured
Understand the steps every case study follows, why the first three happen before any boxes are drawn, and why that order is not decoration.
2.
Designing YouTube Likes Counter
11 lessons
Step 1: System Definition
Define the YouTube likes counter: what the system has to do, which reactions it tracks, and the scope that the rest of the design works within.
Step 2: Requirements
Set the functional and non-functional requirements for a likes counter, and see which of them will shape the design that follows the most.
Step 3: Capacity Estimation
Estimate the traffic and storage for a likes counter, and find the numbers that decide the design before any component has been chosen.
Step 4: API Design
Design the API for a likes counter: the endpoints clients call, what each one takes and returns, and why the shape of it matters.
Step 5: High-Level Design
Walk the high-level design of a likes counter, the parts it is built from, and how the write path and the read path move through them.
Step 6: Database Schema
Design the schema for a likes counter, with one row per user reaction and a separate totals table, and see what that costs each read and write.
Step 7: Detailed Component Design
Compare synchronous counting, asynchronous counting with Kafka, and a hybrid of the two, and see which approach this design picks and why.
Step 8: Toggles and Idempotency
Understand why a like is a state change and not an increment, how the read-then-write race appears, and how an idempotency key closes it.
Step 9: Scalability and Performance
Scale a likes counter: shard the two stores, handle the hot key in the cache, serve 250,000 reads per second, and limit vote manipulation.
Step 10: Failure Modes and Operations
Walk the five real failures of a likes counter, from a lagging consumer to a lost region, what the design does about each, and what to watch.
Quiz
Test your understanding of the likes counter design: requirements and estimation, the counting approaches, idempotency, sharding, and failures.
3.
Designing Unique ID Generator
9 lessons
Step 1: System Definition
Define the unique ID generator: what the service must guarantee about uniqueness and ordering, and the scope the rest of the design works within.
Step 2: Requirements
Set the functional and non-functional requirements for an ID generator, and see which of those guarantees drives every later decision.
Step 3: Capacity Estimation
Estimate how many IDs the service must produce and how little each one costs, and see why the call itself is the real expense to design around.
Step 4: API Design
Design the API for an ID generator, in a shape that decides how often clients have to call the service at all, and what each call returns.
Step 5: High-Level Design
Decide between a library and a service for ID generation, then walk the high-level design of the service that sits behind one endpoint.
Step 6: ID Generation Strategies
Compare the ID generation approaches, design Snowflake IDs and opaque UUIDs, and handle state management and failure recovery for each.
Step 7: Scalability and Performance
Scale an ID generator by adding nodes, understand why that is almost all it takes, and learn the three numbers that cap how far it goes.
Step 8: Failure Modes and Operations
Walk the failures of an ID generator: a clock moving backwards, a node restart, an unreachable coordinator, and a reused machine number.
Quiz
Test your understanding of the ID generator design: uniqueness and ordering, Snowflake IDs and UUIDs, clock skew, and machine numbers.
4.
Designing Notification Service
10 lessons
Step 1: System Definition
Define the notification service: the kinds of message it sends, the channels it sends them over, and the scope the rest of the design sits within.
Step 2: Requirements
Set the functional and non-functional requirements for a notification service, including channels, user preferences, and delivery guarantees.
Step 3: Capacity Estimation
Estimate the daily notification volume and the fan-out of a single publish, and find the numbers the rest of the design has to carry.
Step 4: API Design
Design the API for a notification service, including the endpoint that accepts work and answers before anything has actually been delivered.
Step 5: High-Level Design
Walk the high-level design of a notification service, and see why creating a notification is kept separate from delivering it.
Step 6: Data Storage and Schema
Design storage for a notification service, splitting the small slow-changing records in SQL from the huge notification history in NoSQL.
Step 7: Detailed Component Design
Go inside the scheduler, the queue, and the workers of a notification service, plus retries, rate limits, templates, and security.
Step 8: Scalability and Performance
Scale a notification service to 150 million notifications a day, and handle the fan-out event where one publish turns into very many.
Step 9: Failure Modes and Operations
Walk the failures of a notification service: a throttling provider, a backed-up queue, a crashed worker, an unreachable recipient, and what to watch.
Quiz
Test your understanding of the notification service design: channels and preferences, queues and workers, fan-out, retries, and failure modes.
5.
Designing Reddit
8 lessons
Step 1: System Definition
Define the Reddit-style platform: posts, comments, votes, feeds, and messages, and the scope that the rest of the design works within.
Step 2: Requirements
Set the functional and non-functional requirements for a Reddit-style platform, and see which of them shape the design that follows.
Step 3: Capacity Estimation
Estimate the workload and the stored data for a Reddit-style platform, and find the numbers that decide how its components must be built.
Step 4: API Design
Design the seven core APIs of a Reddit-style platform, from the home feed and posts to votes, messages, notifications, and search.
Step 5: High-Level Design
Walk the high-level design of a Reddit-style platform as a set of single-purpose services, and follow the submission and the read flows.
Step 6: Detailed Component Design
Design the data model, voting and scores, feed generation and ranking, messaging, notifications, and search for a Reddit-style platform.
Step 7: Scalability and Performance
Scale a Reddit-style platform with stateless services, sharding and replication, caching, asynchronous processing, and traffic management.
Quiz
Test your understanding of the Reddit design: the data model, voting and ranking, feed generation, messaging, search, and sharding.
6.
Design Google Calendar
9 lessons
Step 1: System Definition
Define the calendar system: events, invitations, recurrence, and shared calendars, and the scope that the rest of the design works within.
Step 2: Requirements
Set the functional and non-functional requirements for a calendar system, from invitations and recurrence to availability and reminders.
Step 3: Capacity Estimation
Estimate the users, events, and queries a calendar system has to carry, and find the numbers the rest of the design must respect.
Step 4: API Design
Design the APIs of a calendar system, for creating and changing events, responding to invitations, and reading a user's schedule.
Step 5: High-Level Design
Walk the high-level architecture of a calendar system, and see how its services divide the work of events, invitations, and reminders.
Step 6: Database Schema
Design the schema for a calendar system: users, calendars, events, recurrence rules, exceptions, invitations, rooms, and access control.
Step 7: Detailed Component Design
Design the event lifecycle, availability and meeting room suggestions, reminder delivery, and time zone handling for a calendar system.
Step 8: Scalability and Performance
Scale a calendar system, covering how its reads and writes spread across machines and where its performance limits show up first.
Quiz
Test your understanding of the calendar design: recurrence and exceptions, invitations, availability lookups, reminders, and time zones.
7.
Designing Gmail
11 lessons
Step 1: System Definition
Define the email system: sending, receiving, storing, threading, and searching mail, and the scope that the rest of the design works within.
Step 2: Requirements
Set the functional and non-functional requirements for an email system, from delivery and search to durability, availability, and privacy.
Step 3: Capacity Estimation
Estimate the mail volume, the stored data, and the query load an email system must carry, and find the numbers that shape the design.
Step 4: RESTful APIs
Design the REST APIs of an email system, for sending mail, fetching an inbox, reading one message, and searching a whole mailbox.
Step 5: High-Level Design
Walk the high-level design of an email system, follow the data flow of one message, and weigh the trade-offs that this design makes.
Step 6: Database Design
Design the storage model behind an email system, and see what each choice costs when a user opens an inbox or searches a mailbox.
Step 7: Detailed Component Design
Design the caching layer, conversation threading, security and privacy measures, and the indexing strategies that make search fast.
Step 8: Scalability and Performance
Scale an email system, covering how storage and search spread across machines and which parts reach their limit first under load.
Step 9: Reliability and Availability
Make an email system reliable: what must never be lost, how replication and failover work, and what users see while a part is down.
Step 10: Evolution and Future Optimizations
See how an email system evolves after launch, which extensions fit it naturally, and where later optimization work pays off the most.
Quiz
Test your understanding of the email design: the storage model, conversation threading, search indexes, caching, reliability, and scaling.
8.
Designing Google News
9 lessons
Step 1: System Definition and Goals
Define the news aggregator: the entities and concepts it works with, the goals it has to meet, and the scope of the design that follows.
Step 2: Requirements
Set the functional and non-functional requirements for a news aggregator, from ingestion and ranking to freshness and availability.
Step 3: Capacity Estimation
Estimate the article volume, the reader traffic, and the storage a news aggregator must carry, and find the numbers that shape the design.
Step 4: High-Level Architecture
Walk the high-level architecture of a news aggregator, and see how ingestion, ranking, and serving are divided between its services.
Step 5: Data Model and Storage
Design the data model and storage for a news aggregator, and see what each choice costs when a reader opens a personalized feed.
Step 6: Detailed Component Design
Design the ingestion and deduplication pipeline, the pull and push feed engine, real-time updates, and the client-facing APIs.
Step 7: Scalability and Performance
Scale a news aggregator, covering how ingestion and feed serving spread across machines and which part limits throughput first.
Step 8: Failure Modes and Operations
Quiz
Test your understanding of the news aggregator design: ingestion and deduplication, ranking, pull and push feeds, and real-time updates.
9.
Design a Recommendation System
8 lessons
Step 1: System Definition
Define the recommendation system: what it recommends, to whom, and when, and the scope that the rest of the design works within.
Step 2: Requirements
Set the functional and non-functional requirements for a recommendation system, from personalization and freshness to latency limits.
Step 3: Capacity Estimation
Estimate the users, events, and recommendation requests the system must carry, and find the numbers that decide how it is built.
Step 4: API Design
Design the APIs of a recommendation system, both for fetching a user's recommendations and for recording the events that later shape them.
Step 5: High-Level Design
Walk the high-level design of a recommendation system, and see why heavy offline computation is kept apart from fast online serving.
Step 6: Database Schema
Design the stores for precomputed recommendations, an item-to-item similarity index, trending content, and real-time user events.
Step 7: Detailed Component Design
Design the recommendation computation workflow, real-time serving and updates, and the caching layers that keep responses fast.
Quiz
Test your understanding of the recommendation design: offline computation, real-time serving, similarity indexes, trending, and caching.
10.
Designing Code Judging System
7 lessons
Step 1: System Definition
Define the code judging system: what a submission is, what the verdict must mean, and the scope that the rest of the design works within.
Step 2: Requirements
Set the functional and non-functional requirements for a code judging system, from running untrusted code to fairness and latency.
Step 3: Capacity Estimation
Estimate the submission rate, the execution time, and the storage a code judging system must carry, and find the limiting numbers.
Step 4: High-Level Architecture
Walk the high-level architecture of a code judging system, from the submission path to the workers that run and grade the code.
Step 5: Data Storage and Indexing
Design storage and indexing for a code judging system, covering submissions, verdicts, test cases, and the queries each one serves.
Step 6: Detailed Component Design
Design the submission queue, the code execution engine, and the leaderboard, and weigh the trade-offs and alternatives for each.
Quiz
Test your understanding of the code judging design: the submission queue, sandboxed execution, test cases, verdicts, and the leaderboard.
11.
Designing Payment System
9 lessons
Step 1: System Definition
Define the payment system: what a payment is, which parties take part, and the scope that the rest of the design has to work within.
Step 2: Requirements
Set the functional and non-functional requirements for a payment system, from refunds and webhooks to correctness and availability.
Step 3: Capacity Estimation
Estimate the transaction rate and the stored records a payment system must carry, and find the numbers that shape the whole design.
Step 4: High-Level Design
Walk the high-level architecture of a payment system, and see how the work of taking, recording, and settling a payment is divided.
Step 5: Database Schema
Design the schema for a payment system: merchants, customers, payment methods, transactions, ledgers, refunds, webhooks, and event logs.
Step 6: Detailed Component Design
Design the payment service as an orchestrator, separate retryable from non-retryable errors, and handle the asynchronous workflow.
Step 7: Scalability and Performance
Scale a payment system without losing correctness, and see which parts of the path limit throughput as transaction volume grows.
Step 8: Failure Modes and Operations
Quiz
Test your understanding of the payment design: ledgers and transactions, retryable errors, refunds, webhooks, and asynchronous workflows.
12.
Designing Flash Sale System
8 lessons
Step 1: System Definition
Define the flash sale system: a million buyers competing for the same item at the same second, and the scope of the design that follows.
Step 2: Requirements
Set the functional and non-functional requirements for a flash sale, including fairness, no overselling, and surviving the opening spike.
Step 3: Capacity Estimation
Estimate the burst traffic a flash sale has to absorb and the data it stores, and find the numbers that decide every later choice.
Step 4: High-Level Architecture
Walk the high-level architecture of a flash sale system, including the caching layer that keeps the opening spike off the database.
Step 5: Database Schema
Design the schema for a flash sale: users, products, inventory, reservations, orders, and payments, plus indexing and partitioning.
Step 6: Detailed Component Design
Design the transaction states, the reservation expiry job, the queue and concurrency control, and the booking service of a flash sale.
Step 7: Failure Modes and Operations
Quiz
Test your understanding of the flash sale design: reservations and expiry, concurrency control, overselling, queues, and the opening spike.
13.
Designing Reminder Alert System
8 lessons
Step 1: System Definition
Define the reminder alert system: what a reminder is, when it must fire, and the scope that the rest of the design works within.
Step 2: Requirements
Set the functional and non-functional requirements for a reminder system, from recurring reminders to on-time, once-only delivery.
Step 3: Capacity Estimation
Estimate the stored reminders and the per-minute firing load a reminder system must carry, and find the numbers that shape the design.
Step 4: High-Level Design
Walk the high-level design of a reminder system, and see how storing a reminder is separated from firing and delivering it on time.
Step 5: Data Model and Storage
Design the data model and storage for a reminder system, so that finding every reminder due in the next minute stays cheap at any size.
Step 6: Detailed Component Design
Design the scheduling algorithm and execution pipeline, per-channel delivery, time zone and daylight saving handling, and failure handling.
Step 7: Scalability and Performance
Scale a reminder system, covering how the firing load spreads across workers and what happens when many reminders fall on one minute.
Quiz
Test your understanding of the reminder design: scheduling and firing, time zones and daylight saving, delivery channels, and failures.
14.
System Design Patterns
22 lessons
Introduction: System Design Patterns
Meet the twenty building blocks collected in this chapter, and learn to recognize each pattern the moment a design calls for it.
1. Bloom Filters
Understand how a Bloom filter answers set membership in very little memory, so a system can skip the files that cannot hold a record.
2. Consistent Hashing
Understand how consistent hashing keeps data movement small when a machine joins or leaves, and how virtual nodes even out the load.
3. Quorum
Understand how a quorum sets how many machines must agree before an operation counts as done, so two clients cannot read two answers.
4. Leader and Follower
Understand how this pattern names one server to resolve conflicting writes, and how its followers replicate the data from it.
5. Write-ahead Log
Understand how a write-ahead log records an intended change before making it, so a machine can tell what it was doing after a crash.
6. Segmented Log
Understand how splitting a growing log into smaller equal-sized parts keeps writes fast and makes the cleanup of old data simple.
7. High-Water Mark
Understand how the high-water mark marks the last safely replicated log entry, so followers never serve a write that could still be lost.
8. Lease
Understand how a lease works as a lock that expires on its own, so a resource is never blocked forever by a holder that never returns.
9. Heartbeat
Understand how a heartbeat is a small, regular signal that tells a distributed system which of its servers are still up and working.
10. Gossip Protocol
Understand how gossip spreads cluster state by having each node share with one random peer, so state reaches everyone without direct checks.
11. Phi Accrual Failure Detection
Understand how phi accrual failure detection replaces an up-or-down verdict with a suspicion level that rises as evidence of failure builds.
12. Split Brain
Understand how a leader-based system can end up with two active leaders, and how it decides which one is real and ignores the other.
13. Fencing
Understand how fencing stops a failed leader that is still running from touching cluster resources once a new leader has been elected.
14. Checksum
Understand how a checksum lets a client detect data corrupted by a bad disk, a network fault, or a bug, instead of accepting it silently.
15. Vector Clocks
Understand how vector clocks tell which replica produced which version of an object, and which of those versions truly conflict.
16. CAP Theorem
Understand which promise a distributed system has to break during a network partition, and when the CAP theorem forces that choice.
17. PACELC Theorem
Understand how PACELC extends CAP by also covering the normal case, when nothing has failed and latency becomes the real trade-off.
18. Hinted Handoff
Understand how hinted handoff keeps writes succeeding while one replica is offline, and how that replica is caught up afterwards.
19. Read Repair
Understand how read repair fixes a stale replica at the moment someone reads it, instead of waiting for a separate repair process.
20. Merkle Trees
Understand how a Merkle tree finds exactly where two large replicas differ, without moving most of the data between them over the network.
Quiz
Test your understanding of the twenty patterns, from Bloom filters and consistent hashing to quorums, leases, fencing, and Merkle trees.
15.
Dynamo: How to design a key value store?
12 lessons
Dynamo: Introduction
Understand what Dynamo is, the design goals behind it, the use cases it was built for, and the simple key-value APIs it exposes.
High-Level Architecture
Walk Dynamo's architecture: data distribution, replication and consistency, temporary failures, node communication, and high availability.
Data Partitioning
Understand how Dynamo distributes data with consistent hashing, and how virtual nodes spread the load and simplify adding a machine.
Replication
Understand optimistic replication in Dynamo, the preference list, the sloppy quorum that absorbs temporary failures, and hinted handoff.
Vector Clocks and Conflicting Data
Understand clock skew, how vector clocks track versions in Dynamo, and how CRDTs and last-write-wins settle conflicting data.
The Life of Dynamo’s put() & get() Operations
Follow a put and a get through Dynamo: choosing a coordinator node, the consistency protocol, and the state machine that handles a request.
Anti-entropy Through Merkle Trees
Understand how Dynamo uses Merkle trees to find differences between replicas cheaply, and the merits and demerits of that approach.
Gossip Protocol
Understand how Dynamo nodes learn about one another through the gossip protocol, and how seed nodes handle external discovery.
Dynamo Characteristics and Criticism
Understand what each Dynamo node is responsible for, the system's characteristics, the criticism of it, and the datastores built on it.
Summary: Dynamo
Review Dynamo in one place: the design decisions behind it, the system design patterns it uses, and where to read further about it.
Quiz: Dynamo
Test your understanding of Dynamo: consistent hashing, sloppy quorums, hinted handoff, vector clocks, Merkle trees, and gossip.
Rapid-Fire Interview Questions: Dynamo
Work through rapid-fire questions on Dynamo, to check that every part of its design is recallable under the pressure of an interview.
16.
Cassandra: How to Design a Wide-column NoSQL Database?
12 lessons
Cassandra: Introduction
Understand what Cassandra is, the background it came from, and the kinds of workload that suit a wide-column distributed database.
High-level Architecture
Walk Cassandra's architecture: its common terms, data partitioning, partition and clustering keys, the partitioner, and the coordinator.
Replication
Understand Cassandra's replication factor and its replication strategies, from simple replication to network topology awareness.
Cassandra Consistency Levels
Understand Cassandra's write and read consistency levels, where hinted handoff fits in, and what the snitch is there to do for reads.
Gossiper
Understand how Cassandra uses the gossip protocol to share cluster state, and how it decides that one of its nodes has failed.
Anatomy of Cassandra's Write Operation
Follow a Cassandra write through the commit log, the memtable, and the SSTable, and see why that path stays so fast under load.
Anatomy of Cassandra's Read Operation
Follow a Cassandra read through caches, the memtable, and SSTables, using Bloom filters, the index summary, and the key cache.
Compaction
Understand how compaction merges Cassandra's SSTables, the compaction strategies available, and why sequential writes matter here.
Tombstones
Understand what a tombstone is in Cassandra, why a delete is written rather than removed, and the problems tombstones go on to cause.
Summary: Cassandra
Review Cassandra in one place: its characteristics, the system design patterns it uses, and where to read further about its design.
Quiz: Cassandra
Test your understanding of Cassandra: partition and clustering keys, consistency levels, the write and read paths, and compaction.
Rapid-Fire Interview Questions: Cassandra
Work through rapid-fire questions on Cassandra, to check that every part of its design is recallable under interview pressure now.
17.
Kafka: How to Design a Distributed Messaging System?
13 lessons
Messaging Systems: Introduction
Understand what a messaging system is, and how the queue model differs from the publish-subscribe model that Kafka is built on.
Kafka: Introduction
Understand what Kafka is, the background it came from, and the use cases that suit a distributed, durable, replayable commit log.
High-level Architecture
Walk Kafka's architecture and its common terms: brokers, records, topics, producers, consumers, the cluster, and cluster coordination.
Kafka: Deep Dive
Understand Kafka's topic partitions, the leader and follower roles, in-sync replicas, and the high-water mark that bounds safe reads.
Consumer Groups
Understand what a Kafka consumer group is, and how the partitions of a topic are distributed between the consumers inside one group.
Kafka Workflow
Follow the Kafka workflow twice, once as plain publish-subscribe messaging and once through a consumer group that shares the partitions.
Cluster Coordination: KRaft and ZooKeeper
Understand what Kafka's coordination layer does, how KRaft handles it, what it improved on ZooKeeper, and how a client finds a leader.
Controller Broker
Understand what the Kafka controller broker does, how split brain can appear, and how a generation clock settles which one is current.
Kafka Delivery Semantics
Understand Kafka's delivery semantics on both sides, for producers writing records and for consumers committing their offsets.
Kafka Characteristics
Understand how Kafka stores messages on disk, how long it retains records, how client quotas work, and where its performance comes from.
Summary: Kafka
Review Kafka in one place, with the patterns it is built from: the high-water mark, leader and follower, split brain, and the segmented log.
Quiz: Kafka
Test your understanding of Kafka: partitions and replicas, the high-water mark, consumer groups, coordination, and delivery semantics.
Rapid-Fire Interview Questions: Kafka
Work through rapid-fire questions on Kafka, to check that every part of its design is recallable under the pressure of an interview.
18.
Chubby: How to Design a Distributed Locking Service?
14 lessons
Chubby: Introduction
Understand what Chubby is and what it is used for, from leader election and naming to small-object storage and distributed locking.
High-level Architecture
Walk Chubby's architecture: the Chubby cell and its servers, the client library, and the general, file, locking, and sequencer APIs.
Design Rationale
Understand why Chubby is a service with coarse-grained advisory locks and a file-like interface, and where it sits on the CAP trade-off.
How Chubby Works
Follow service and client initialization in Chubby, then work through a leader election example with the pseudocode behind it.
File, Directories, and Handles
Understand Chubby's file and directory nodes, the metadata each one carries, and the handles through which clients read and change them.
Locks, Sequencers, and Lock-delays
Understand Chubby's locks, how a sequencer proves a lock is still held, and how a lock-delay protects a resource after a client fails.
Sessions and Events
Understand the Chubby session and its protocol, what KeepAlive does, how sessions are optimized, and what happens during a failover.
Master Election and Chubby Events
Understand how a newly elected Chubby master initializes itself, and the events Chubby sends to its clients when things change.
Caching
Understand how the Chubby client cache keeps reads cheap, and how the master invalidates that cache so clients never read stale data.
Database
Understand how Chubby keeps its own database safe, through regular backups and through mirroring to other cells for wider availability.
Scaling Chubby
Understand how Chubby scales to many clients, through proxies and partitioning, and what its designers learned from doing so.
Summary: Chubby
Review Chubby in one place: the design decisions behind it, the system design patterns it uses, and where to read further about it.
Quiz: Chubby
Test your understanding of Chubby: cells and servers, advisory locks and sequencers, sessions and KeepAlive, caching, and scaling.
Rapid-Fire Interview Questions: Chubby
Work through rapid-fire questions on Chubby, to check that every part of its design is recallable under the pressure of an interview.
19.
HDFS: How to Design File Storage System?
12 lessons
Hadoop Distributed File System: Introduction
Understand what HDFS is, the background it came from, and the APIs it offers for storing very large files across many machines.
High-level Architecture
Walk the HDFS architecture, with its NameNode and DataNodes, and compare the design against the Google File System it came from.
Deep Dive
Understand the HDFS cluster topology, rack aware replication, its synchronization semantics, and the consistency model it offers.
Anatomy of a Read Operation
Follow an HDFS read from the NameNode lookup to the DataNode transfer, and see what a short circuit read saves a local client.
Anatomy of a Write Operation
Follow an HDFS write, from the NameNode allocating each block to the pipeline of DataNodes that store it and acknowledge it in turn.
Data Integrity & Caching
Understand how HDFS protects data integrity with checksums and the block scanner, and how its caching keeps hot blocks fast to read.
Fault Tolerance
Understand how HDFS survives a DataNode failure through replication and heartbeats, and what happens when the NameNode itself fails.
HDFS High Availability (HA)
Understand the HDFS high availability design, with the quorum journal manager, ZooKeeper, and the fencing that makes failover safe.
HDFS Characteristics
Understand HDFS security and permissions, federation for scaling its namespace, erasure coding, and how it is used in practice.
Summary: HDFS
Review HDFS in one place: the design decisions behind it, the system design patterns it uses, and where to read further about it.
Quiz: HDFS
Test your understanding of HDFS: the NameNode and DataNodes, rack aware replication, the read and write paths, and high availability.
Rapid-Fire Interview Questions: HDFS
Work through rapid-fire questions on HDFS, to check that every part of its design is recallable under the pressure of an interview.
20.
GFS: How to Design a Distributed File System Storage?
15 lessons
Google File System: Introduction
Understand what the Google File System is, the background it came from, the workloads it was built for, and the APIs it exposes.
High-level Architecture
Walk the GFS architecture and its parts: chunks and chunk handles, the cluster, its chunkservers, the master, and the client.
Single Master and Large Chunk Size
Understand why GFS uses a single master and a very large chunk size, and how lazy space allocation keeps that choice affordable.
Metadata
Understand how the GFS master keeps metadata in memory, how it learns chunk locations, and how the operation log and checkpoints protect it.
Master Operations
Understand the GFS master's work: namespace locking, replica placement, re-replication, rebalancing, and stale replica detection.
Anatomy of a Read Operation
Follow a GFS read, from the client asking the master where a chunk lives to reading the data straight from a nearby chunkserver.
Anatomy of a Write Operation
Follow a GFS write, and understand how a chunk lease lets one replica order the writes that every other replica then applies.
Anatomy of an Append Operation
Follow a GFS record append, and see why appending, not overwriting, is the operation this whole file system was optimized for.
GFS Consistency Model and Snapshotting
Understand what the GFS consistency model actually promises after a write or an append, and how snapshotting is done cheaply.
Fault Tolerance, High Availability, and Data Integrity
Understand how GFS tolerates failures, how chunk replication keeps it available, and how checksums protect the integrity of the data.
Garbage Collection
Understand how GFS reclaims space through lazy deletion, and weigh the advantages of that approach against its disadvantages.
Criticism on GFS
Understand the problems that come with a single GFS master and with its very large chunk size, and what they cost in practice.
Summary: GFS
Review the Google File System in one place: its design, the system design patterns it uses, and where to read further about it.
Quiz: GFS
Test your understanding of GFS: chunks and the single master, leases and writes, record appends, the consistency model, and deletion.
Rapid-Fire Interview Questions: GFS
Work through rapid-fire questions on GFS, to check that every part of its design is recallable under the pressure of an interview.
21.
BigTable: How to Design a Wide Column Storage System?
15 lessons
BigTable: Introduction
Understand what BigTable is, the background it came from, and the kinds of workload that suit a wide-column storage system at scale.
BigTable Data Model
Understand the BigTable data model: rows and their keys, column families, the columns inside them, and the timestamps on each cell.
System APIs
Understand the BigTable APIs, both the metadata operations that manage tables and families and the data operations that read and write.
Partitioning and High-level Architecture
Understand how BigTable splits a table into tablets, and walk the high-level architecture that stores and serves those tablets.
SSTable
Understand how BigTable stores its tablets in GFS as SSTables, and keep the difference between a table, a tablet, and an SSTable clear.
GFS and Chubby
Understand what BigTable depends on the Google File System for, and what it depends on Chubby for, and why it needs both of them.
Bigtable Components
Understand the two kinds of server in BigTable: the master that assigns and monitors work, and the tablet servers that do it.
Working with Tablets
Understand how BigTable locates and assigns tablets, how it monitors its tablet servers, and how it balances load between them.
The Life of BigTable's Read & Write Operations
Follow a write and then a read through BigTable, and see which parts of its storage each one has to touch along the way, and why.
Fault Tolerance and Compaction
Understand how BigTable tolerates the failure of a tablet server or its master, what it inherits from GFS and Chubby, and how it compacts.
BigTable Refinements
Understand the refinements that make BigTable fast: locality groups, compression, caching, Bloom filters, and a unified commit log.
BigTable Characteristics
Understand BigTable's performance, how it compares with Dynamo, and which of the later datastores were built on its principles.
Summary: BigTable
Review BigTable in one place: the design decisions behind it, how its parts fit together, and where to read further about it.
Quiz: BigTable
Test your understanding of BigTable: the data model, tablets and SSTables, its use of GFS and Chubby, the read and write paths, and compaction.
Rapid-Fire Interview Questions: BigTable
Work through rapid-fire questions on BigTable, to check that every part of its design is recallable under the pressure of an interview.
22.
Final Assessment
2 lessons
Final Assessment I: The Twelve Case Studies
Test what you learned across the twelve case studies, from requirements and estimation to component design, scaling, and failure modes.
Final Assessment II: Patterns and the Deep Dives
Test what you learned from the system design patterns and from the architecture deep dives into real distributed systems and their trade-offs.
Grokking Microservices Design Patterns
Master microservices design patterns for designing scalable, resilient, and more manageable systems.
• 19 Chapters • 158 Lessons
Hide Contents
1.
Introduction
2 lessons
Who Should Take This Course?
Understand who this course is for, why these microservice patterns matter, and what naming a pattern actually gives you as an engineer.
The Course at a Glance
See how the pattern chapters are built, so you know what each one will cover before you open the first chapter of the course.
2.
Strangler Fig Pattern
8 lessons
Introduction
Understand why a legacy system is replaced piece by piece rather than all at once, how the approach works, and why teams choose it.
The Problem: Legacy Systems
Understand what makes a legacy system hard to work on, why replacing it outright so often fails, and how this pattern helps instead.
The Strangler Pattern: A Solution
Understand how the strangler fig pattern replaces a legacy system gradually, while the old and the new system keep running together.
The Architecture of the Strangler Pattern
Understand the architecture of the strangler fig pattern: replacing one area at a time, the facade in front, and migrating in phases.
Strangler Pattern: A Detailed Example
Work through a migration in detail: the four operations, the routing table, choosing which customers move, and reading the trace.
Key Insights and Implications
Understand what the strangler fig pattern asks of a team, including the organizational side that decides whether it really succeeds.
Flashcards Review
Review the strangler fig pattern with flashcards on the facade, incremental routing, phased migration, and the big-bang rewrite.
Chapter Assessment
Test your understanding of the strangler fig pattern: the facade, the routing table, phased migration, and when to reach for it.
3.
API Gateway Pattern
7 lessons
Introduction to the API Gateway Pattern
Understand why the API gateway pattern exists, and what a gateway does for the clients and the services on either side of it.
Advantages of API Gateway Pattern
Understand the advantages of putting an API gateway in front of your services, and which shared jobs it takes off each service.
API Gateway Pattern: An Example
Work through an API gateway example: what the gateway adds, its route table, the order of its checks, and what the counts show.
Performance Implications
Understand what can go wrong with an API gateway, and what it costs in latency and throughput to put one in the request path.
System Design Example
Walk a system design built around an API gateway, the services behind it, and how the gateway handles two different requests.
Flashcards Review
Review the API gateway pattern with flashcards on routing, the shared concerns it absorbs, its route table, and the latency it adds.
Chapter Assessment
Test your understanding of the API gateway pattern: what it does, its route table and checks, its advantages, and what it costs.
4.
Backends for Frontends (BFF) Pattern
8 lessons
Introduction to BFF
Understand why different clients need different backends, how Netflix used the idea, and what a backend for frontend gives you.
The Problem: Traditional Backend Models
Understand the problems of one backend for every client: over-fetching, tangled code, and a lack of flexibility as clients multiply.
The Architecture of the BFF Pattern
Understand the architecture of the BFF pattern, its three parts, and what each backend for frontend is responsible for serving.
BFF Pattern: An Example
Work through a BFF example: one shared API against one backend per frontend, what the example measures, and where the cost moved.
Performance Implications
Understand the problems BFF brings, from code duplication to coordination overhead, and the performance effects of each of them.
System Design Examples
Walk the Netflix scenario end to end: how BFF was applied, the workflow that resulted, the benefits it brought, and the challenges.
Flashcards Review
Review the BFF pattern with flashcards on client-specific backends, over-fetching, code duplication, and coordination overhead.
Chapter Assessment
Test your understanding of the BFF pattern: client-specific backends, over-fetching, duplication, and when the pattern really fits.
5.
Service Discovery Pattern
11 lessons
What is Service Discovery Pattern?
Understand why service discovery matters in a system where instances come and go, and exactly which problem the pattern solves.
The Problem: Service Coordination in Distributed Systems
Understand how services coordinate in a distributed system, and why hard-coded addresses stop working once instances move around.
Service Discovery Pattern: A Solution
Understand how service discovery solves that problem, so a caller can find a healthy instance without knowing its address first.
The Architecture of the Service Discovery Pattern
Understand the service discovery architecture, the role of the service registry, and how client-side and server-side discovery differ.
The Inner Workings of the Service Discovery Pattern
Understand self-registration against third-party registration, and the role health checks play in keeping a registry honest.
Service Discovery Pattern: An Example
Work through an example: the registry's three jobs, heartbeats and the time to live, and choosing between healthy instances.
Performance Implications and Special Considerations
Understand the latency a registry adds, how it scales, its fault tolerance, and the load balancing and failover strategies around it.
System Design Examples
See service discovery in use in microservice and cloud systems, through an e-commerce example and a streaming platform example.
Security Considerations
Understand the security side of service discovery, and what a registry must protect as services register and look each other up.
Flashcards Review
Review service discovery with flashcards on the registry, client-side and server-side discovery, registration, and health checks.
Chapter Assessment
Test your understanding of service discovery: the registry, client-side and server-side discovery, registration, and health checks.
6.
Circuit Breaker Pattern
9 lessons
Introduction
Understand why a circuit breaker exists, with an example of what happens in microservices when one dependency starts to fail.
The Problem: The Struggles of Distributed Systems and Service Failures
Understand how cascading failures spread through a distributed system, and how unresponsive services turn waiting into wasted work.
The Circuit Breaker Pattern: An Effective Shield Against Cascading Failures
Understand the circuit breaker's architecture and inner workings, how to integrate one, and how to choose the settings it needs.
Circuit Breaker Pattern: An Example
Work through an example: the three states of a breaker, what moves it between them, and why refusing calls helps a failing system.
Performance Implications and Special Considerations
Understand how to tune circuit breaker thresholds and timeouts, with the best practices and the trade-offs that come with them.
System Design Examples
See the circuit breaker in use across microservice calls, integrations with an external API, and access to a shared database.
Summary
Review the circuit breaker pattern in one place: its states, its settings, what it protects, and where it belongs in a system.
Flashcards Review
Review the circuit breaker with flashcards on its three states, thresholds and timeouts, half-open probes, and cascading failures.
Chapter Assessment
Test your understanding of the circuit breaker: its three states, the transitions between them, tuning, and cascading failures.
7.
Bulkhead Pattern
11 lessons
Introduction
Understand the challenge of cascading failures, and why isolating parts of a system stops one failure from taking the rest down.
The Problem: Failure Propagation in Distributed Systems
Understand how failure propagates through a distributed system when every request shares the same single pool of resources.
The Bulkhead Pattern: A Solution
Understand how the bulkhead pattern isolates failures, and where its name comes from in the sealed compartments of a ship.
The Architecture
Understand the building blocks of the bulkhead pattern: isolating components, allocating resources, and handling the interactions.
The Inner Workings
Understand isolation and resource allocation in practice, failure detection and recovery, and what bulkheads do not solve for you.
Bulkhead Pattern: An Example
Work through a bulkhead example: the resource being divided, the two arrangements compared, and both halves of the trade involved.
Performance Implications and Special Considerations
Understand what bulkheads buy in useful work and predictable capacity, what they cost in response time, and how to size them.
System Design Examples
See bulkheads in use across e-commerce, online gaming, financial systems, and platforms serving many customers at once.
Conclusion
Review the value of the bulkhead pattern in a distributed system, and when the isolation it brings is worth what it costs you.
Flashcards Review
Review the bulkhead pattern with flashcards on isolation, resource pools, failure propagation, and sizing each compartment.
Chapter Assessment
Test your understanding of the bulkhead pattern: isolation, resource allocation, failure propagation, and sizing compartments.
8.
Retry Pattern
9 lessons
Introduction
Understand why distributed systems need retries at all, and the kind of transient failure that makes a second attempt worthwhile.
The Retry Pattern: A Solution to Unreliable External Resources
Understand how retries absorb transient failures, the trade-offs they bring, and which other strategies belong alongside them.
The Architecture of the Retry Pattern
Understand the architecture of the retry pattern, and where the decision to retry belongs in the path of a single request.
Retry Pattern: An Example
Work through a retry example: why waiting matters, what not to retry, how retries multiply, and what five clients do to a service.
Performance Implications
Understand how retries can make an overload worse, the strategies that mitigate that, and when not to use the pattern at all.
Use Cases and System Design Examples
See retries in use across web services, database operations, and microservices, with the system design examples behind each.
Conclusion
Review the retry pattern: what it fixes, what it cannot fix, and the safeguards that keep retries from amplifying a failure.
Flashcards Review
Review the retry pattern with flashcards on transient errors, backoff and jitter, idempotency, and the amplification of retries.
Chapter Assessment
Test your understanding of the retry pattern: transient errors, backoff and jitter, idempotency, and the amplification of retries.
9.
Sidecar Pattern
9 lessons
Introduction to the Sidecar Pattern
Understand what a sidecar is, how it runs beside an application rather than inside it, and the strengths that make the pattern useful.
The Problem: Monolithic Application Management
Understand the problems of managing a monolithic application: scaling it, its complexity, and the technology constraint it imposes.
A Solution: The Sidecar Pattern
Understand how a sidecar brings flexibility, resource limits, fault isolation, lower complexity, and freedom in choice of technology.
The Architecture of the Sidecar Pattern
Understand the architecture of the pattern: one pod with two containers, several sidecars, a network proxy, and a shared lifecycle.
Sidecar Pattern: An Example
Work through an example: what gets moved out of the application, the wrapping and unwrapping, and what the application is left with.
Performance Implications
Understand the performance implications of a sidecar, and the special considerations before you add one beside every service.
System Design Examples
See where the sidecar pattern fits, with system design examples of the jobs that teams usually move out into a sidecar container.
Flashcards Review
Review the sidecar pattern with flashcards on the sidecar container, the shared lifecycle, network proxying, and fault isolation.
Chapter Assessment
Test your understanding of the sidecar pattern: the sidecar container, the shared lifecycle, proxying, and what it costs to run.
10.
Service Mesh Pattern
10 lessons
Introduction to the Service Mesh
Understand what the service mesh pattern says, why it matters once every service repeats the same network logic, and what follows.
The Problem: Network Logic in Every Service
Understand why the same network code ends up inside every service, what goes wrong because of it, and why a library is not enough.
The Service Mesh: A Solution
Understand how moving network logic into a proxy meets the requirement, what the application is left doing, and what remains unsolved.
The Architecture of a Service Mesh
Understand the data plane and the control plane, mutual TLS between services, shifting traffic without a deploy, and what a mesh sees.
Service Mesh: An Example
Work through a mesh example: a retry and timeout rule, shifting ten percent of traffic, and the path one request actually takes.
Performance Implications and Special Considerations
Understand the two extra hops a mesh adds to every call, the resource cost per pod, the control plane dependency, and debugging.
Use Cases and System Design Examples
See when a service mesh pays for itself, when it is simply too much machinery, and the system designs where it does belong.
Conclusion
Review what a service mesh gives you, what it asks in return, and where it sits among the other patterns in this course.
Flashcards Review
Review the service mesh with flashcards on the data and control planes, sidecar proxies, mutual TLS, and shifting traffic safely.
Chapter Assessment
Test your understanding of the service mesh: the data and control planes, proxies, mutual TLS, traffic shifting, and its costs.
11.
Database per Service Pattern
10 lessons
Introduction to Database per Service
Understand what the database per service pattern says, why it matters for the independence of a service, and what this chapter covers.
The Problem: One Shared Database
Understand the costs of one shared database: schema coupling, performance interference, a single failure domain, and coordination.
Database per Service: A Solution
Understand the rule behind database per service, what changes immediately once you follow it, and what you give up in exchange.
The Architecture of Database per Service
Understand the three levels of isolation, polyglot persistence, and how to handle the shared reference data every service wants.
Database per Service: An Example
Work through an example: the join that has to go, API composition in code, both costs counted, and where it stops being small.
Performance Implications and Special Considerations
Understand that queries now cross the network, that data gets duplicated, that there are more databases to run, and how to limit it.
Use Cases and System Design Examples
See when the database per service pattern fits, when it does not, and the system designs where each of those answers applies.
Conclusion
Review what database per service gives you, what it asks in return, and which patterns are worth reading next alongside it.
Flashcards Review
Review database per service with flashcards on schema coupling, the isolation levels, polyglot persistence, and API composition.
Chapter Assessment
Test your understanding of database per service: schema coupling, isolation, polyglot persistence, and composing data across services.
12.
Saga Pattern
11 lessons
Introduction to Saga Pattern
Understand why a transaction is hard to run across services, the problem that creates, and how the saga pattern answers it.
The Problem: Traditional Transaction Models
Understand the traditional transaction models, where they break down across services, and why distributed work needs another way.
The Saga Pattern: A Solution
Understand what a saga is, how the pattern works, and the difference between the choreography and orchestration styles of running one.
The Architecture of the Saga Pattern
Understand the architecture of a saga: local transactions, choreography and orchestration, eventual consistency, and compensations.
The Inner Workings of the Saga Pattern
Understand how a saga undoes work in reverse order, what the saga log is for, and what to do when a compensation is not enough.
Saga Pattern: An Example
Work through a saga example: three rules the code shows, why compensations cannot give up, and what a saga does not give you.
Performance Implications
Understand the complexity and the extra latency a saga brings, and the consistency, idempotency, and ordering it demands of you.
System Design Examples
See sagas in use across e-commerce and travel booking, with worked system design examples including an online food delivery service.
Conclusion
Review the saga pattern and the architecture under it, how the theory turns into practice, real applications, and what to read next.
Flashcards Review
Review the saga pattern with flashcards on local transactions, compensations, the saga log, choreography, and orchestration.
Chapter Assessment
Test your understanding of the saga pattern: local transactions, compensations, the saga log, choreography, and orchestration.
13.
Transactional Outbox Pattern
10 lessons
Introduction to the Transactional Outbox Pattern
Understand what the transactional outbox pattern says, why it matters whenever a service writes data and publishes an event, and more.
The Problem: Dual Writes
Understand what a dual write is, the two orders in which it can fail, why the obvious fixes do not work, and what a real fix must do.
The Transactional Outbox: A Solution
Understand how one transaction plus a relay replaces two writes, why that meets the requirement, and the at-least-once price you pay.
The Architecture of the Outbox Pattern
Understand the outbox table and its two relay styles, a polling publisher and transaction log tailing, and how to choose between them.
Transactional Outbox: An Example
Work through an outbox example: the write path, the relay, an idempotent consumer, and the trace of one order through all of them.
Performance Implications and Special Considerations
Understand the publish delay, the write amplification, the growth of the outbox table, and duplicates and ordering under heavy load.
Use Cases and System Design Examples
See when the transactional outbox fits, when it is more machinery than you need, and the system designs where it earns its place.
Conclusion
Review what the transactional outbox gives you, what it asks in return, and which patterns are worth reading next alongside it.
Flashcards Review
Review the transactional outbox with flashcards on dual writes, the outbox table, relay styles, and idempotent consumers.
Chapter Assessment
Test your understanding of the transactional outbox: dual writes, the outbox table, the relay styles, and idempotent consumers.
14.
Event-Driven Architecture Pattern
11 lessons
Introduction
Understand how architecture patterns led here, and what the event-driven architecture pattern is in its own terms before the detail.
The Problem: Managing Complex Interactions in Distributed Systems
Understand why complex interactions break simple designs, the call for asynchronous messaging, and the data consistency this raises.
Event-Driven Architecture: A Promising Solution
Understand the benefits of event-driven architecture, and the components that an event-driven system is actually assembled from.
The Architecture of the Event-Driven Architecture Pattern
Understand the architecture of an event-driven system: its components, how they are structured, and how the whole thing operates.
The Inner Workings of the Event-Driven Architecture Pattern
Understand event generation and propagation, routing through event channels, event processing and state change, and real-time use.
Event-Driven Architecture Pattern: An Example
Work through an example: what changes between the two versions, the failure worth watching, and why ordering is the hard part.
Performance Implications and Special Considerations
Understand the scalability, latency, error handling and durability, complexity, and schema compatibility that events bring with them.
Use Cases and System Design Examples
See event-driven designs in real-time analytics, IoT, e-commerce, and microservices, with a ride-sharing example and when to avoid it.
Conclusion
Review the event-driven architecture pattern: what it gives you, what it asks in return, and where it belongs among the others.
Flashcards Review
Review event-driven architecture with flashcards on events and channels, producers and consumers, ordering, and schema changes.
Chapter Assessment
Test your understanding of event-driven architecture: events and channels, producers and consumers, ordering, and schema changes.
15.
CQRS (Command Query Responsibility Segregation)
10 lessons
Introduction
Understand what CQRS is and why it is used in microservices, before going into how commands and queries are actually separated.
The Problem: Traditional CRUD Operations
Understand the limitations of traditional CRUD operations, and the problems of scale and performance that push teams towards CQRS.
CQRS Pattern: A Solution
Understand how CQRS answers those limits by splitting the write side of a system from the read side, and what that split buys you.
The Architecture of the CQRS Pattern
Understand the CQRS architecture: separate command and query models, separate read and write databases, and the role of events.
The Inner Workings of the CQRS Pattern
Understand the path of a command through validation, handling, and events, the path of a query, and how the two sides are synchronized.
CQRS Pattern: An Example
Work through a CQRS example: the command model, the query model, and the infrastructure that keeps the two of them in step.
Issues, Special Considerations, and Performance Implications
Understand the complexity of CQRS, how to manage data consistency, its performance implications, and how to handle transactions.
System Design Examples
See CQRS in high-performance applications, complex business logic, and collaborative domains, with event-driven design examples.
Flashcards Review
Review CQRS with flashcards on command and query models, separate read and write stores, synchronization, and eventual consistency.
Chapter Assessment
Test your understanding of CQRS: the command and query models, separate read and write stores, synchronization, and consistency.
16.
Event Sourcing Pattern
10 lessons
Introduction to Event Sourcing
Understand what event sourcing says, why storing what happened matters more than storing the result, and what this chapter covers.
The Problem: Storing Only the Current State
Understand how an update destroys information, the questions you can no longer answer, and the limits of the usual workarounds.
Event Sourcing: A Solution
Understand how appending instead of updating lets a replay rebuild state, and why each event is recorded as a business fact.
The Architecture of Event Sourcing
Understand the event store, concurrency control, snapshots, projections and read models, and how to evolve an event schema safely.
Event Sourcing: An Example
Work through an example: the events, the aggregate, command handling and replay, and why the store has no balance column at all.
Performance Implications and Special Considerations
Understand the cost of a replay, the growth of storage, eventually consistent reads, the difficulty of deleting, and the team cost.
Use Cases and System Design Examples
See when event sourcing fits and when it does not, with worked examples of a payments ledger and a shopping cart and order system.
Conclusion
Review what event sourcing gives you, what it asks in return, and which patterns are worth reading next alongside it.
Flashcards Review
Review event sourcing with flashcards on the event store, replay, snapshots, projections, and the evolution of event schemas.
Chapter Assessment
Test your understanding of event sourcing: the event store, replay and snapshots, projections, and evolving an event schema.
17.
Configuration Externalization Pattern
10 lessons
Introduction
Understand what counts as configuration in a service, and why the traditional approach of shipping it with the code breaks down.
The Problem: Configuration Management in a Microservices Architecture
Understand the cost of hardcoded settings across many services: coupled deployments, and values that cannot change while running.
The Solution: Configuration Externalization Pattern
Understand what the configuration externalization pattern says, how a service uses it, and how values change without a deployment.
How Configuration Externalization Works
Understand the two parts of the pattern, the configuration server, changing a value without a restart, and security across them.
Configuration Externalization: A Code Example
Work through a code example with Spring Cloud Config: the server and its store, the client, refreshing values, and encrypting one.
Considerations and Implications
Understand data security, the configuration server as a single point of failure, rollbacks, and validating a value before it applies.
Use Cases and Real-world Examples
See configuration externalization in use across e-commerce, financial services, food, a startup, and a telecommunications company.
Conclusion
Review what the pattern gives you, what it costs, where it fits among the other patterns, and what is worth reading next.
Flashcards Review
Review configuration externalization with flashcards on the configuration server, refreshing values, secrets, and rollbacks.
Chapter Assessment
Test your understanding of configuration externalization: the configuration server, refreshing values, secrets, and rollbacks.
Grokking Design Patterns for Engineers and Managers
Unlock the power of design patterns: Elevate your coding skills with timeless solutions for top-notch software design.
• 4 Chapters • 31 Lessons
Hide Contents
1.
Design Patterns
3 lessons
What are Design Patterns?
Understand what a design pattern is, why engineers use them, and the categories that all of the patterns in this course fall into.
Classification of Design Patterns
See how design patterns are classified into the creational, structural, and behavioral groups, and what each group is concerned with.
About this Course
Understand how this course is organized, what each pattern lesson contains, and how to work through the patterns in a useful order.
2.
Creational Patterns
7 lessons
Introduction
Understand what creational patterns are for, and meet the common ones before studying each of them in its own lesson in turn.
Singleton Pattern
Understand the structure and implementation of the singleton pattern, and why the naive lazy version of it is not thread safe.
Factory Method Pattern
Understand the structure and implementation of the factory method pattern, how it differs from a simple factory, and where it is used.
Abstract Factory Pattern
Understand the structure and implementation of the abstract factory pattern, choosing the factory once, and the variants it allows.
Builder Pattern
Understand the structure and implementation of the builder pattern, the director you rarely see in practice, and the staged variant.
Prototype Pattern
Understand the structure and implementation of the prototype pattern, shallow against deep copying, and the traps that come with it.
Summary
Review the creational patterns in one place: what each one creates, how they differ, and when to reach for each of them in code.
3.
Structural Patterns
9 lessons
Introduction
Understand what structural patterns are for, and meet the types of structural pattern before studying each one of them in detail.
Adapter Pattern
Understand the structure and implementation of the adapter pattern, how it differs from facade, decorator, and proxy, and its limits.
Bridge Pattern
Understand the structure and implementation of the bridge pattern, how it differs from strategy, and what getting the split wrong costs.
Composite Pattern
Understand the structure and implementation of the composite pattern, its transparent and safe variants, and two traps worth knowing.
Decorator Pattern
Understand the structure and implementation of the decorator pattern, and why the order of the decorators is a correctness decision.
Facade Pattern
Understand the structure and implementation of the facade pattern, the four patterns that look identical to it, and its failure mode.
Flyweight Pattern
Understand the structure and implementation of the flyweight pattern, why it is not a cache, and the two mistakes that undo it.
Proxy Pattern
Understand the structure and implementation of the proxy pattern, how it differs from a decorator, and where this pattern goes wrong.
Summary
Review the structural patterns in one place: what each one composes, how the similar ones differ, and when each of them applies.
4.
Behavioral Patterns
12 lessons
Introduction
Understand what behavioral patterns are for, and meet the types of behavioral pattern before studying each one of them in detail.
Chain of Responsibility Pattern
Understand the chain of responsibility pattern, its structure, the bug it invites, and why the order of handlers is part of the design.
Command Pattern
Understand the structure and implementation of the command pattern, and why an undo has to restore state rather than recompute it.
Iterator Pattern
Understand the iterator pattern, its structure and implementation, hiding the shape but not the cost, and three ways iterators break.
Mediator Pattern
Understand the structure and implementation of the mediator pattern, how it differs from observer, and the god object it can become.
Memento Pattern
Understand the memento pattern, its structure and implementation, how it differs from command undo, and the bug that ruins a snapshot.
Observer Pattern
Understand the structure and implementation of the observer pattern, how it differs from mediator, and four ways observers go wrong.
State Pattern
Understand the structure and implementation of the state pattern, how it differs from strategy, and when a state machine outgrows it.
Strategy Pattern
Understand the structure and implementation of the strategy pattern, why state and bridge share its diagram, and where it goes wrong.
Template Method Pattern
Understand the structure and implementation of the template method pattern, how it differs from strategy, and where it goes wrong.
Visitor Pattern
Understand the structure and implementation of the visitor pattern, the one question that decides it, and how it pairs with composite.
Summary
Review the behavioral patterns in one place: how each distributes work, which of them look alike, and when each is the right choice.
What people say about our courses

Annual Subscription
Get instant access to all current and upcoming courses for one year.
OR
Lifetime Access - This Bundle
Get lifetime access to this bundle only.
Discounted Prices for Your Region
Certification on completing the course.
One-Stop Portal For Tech Interviews.
Copyright © 2026 Design Gurus, LLC. All rights reserved.