The Four Core Challenges of a Large System
A system with a few hundred users needs one server and one database. Because every request goes to the same machine and every read returns the latest data, system design with few users reduces to ordinary programming.
Scale changes this picture. As the number of users grows, four challenges appear. Three of them come directly from the load: too many requests, too much data, and slow responses. The fourth challenge, stale reads, comes from the fixes for the first three, and almost every technique in this course addresses one of these four challenges.
Grow the app below, which starts with a few thousand users, one app server, and one database. Watch which challenge appears first, then turn on its fix to see the diagram add the components that each fix needs.
The order in the widget depends on its illustrative numbers, whereas the order in a real system depends on the product. A video site runs out of storage early, while a chat app runs out of request capacity early. Even so, the four challenges and their fixes stay the same.
Challenge 1: Too Many Requests
One machine can handle only a limited number of requests per second. Past that limit, requests wait in a queue, response times grow, and requests start to time out.
The fix is to replicate by running several identical copies and spreading requests among them. For application code, a load balancer sends each request to one of several identical servers. For data, read replicas keep copies of the database, and each copy can answer reads.
Replication works for application servers because they are stateless, meaning any server can handle any request. The Load Balancer and Database Replication lessons explain both mechanisms in detail.
Challenge 2: Too Much Data
Replication copies all of the data to each machine, which does not help when the data no longer fits on one machine. All the posts on a social network, or all the videos on a video site, are far larger than one disk.
The fix is to shard the database by splitting the data into parts and putting each part on a different machine. A shard key decides which part receives each record. For example, if posts are sharded by user_id, all posts from one user live on the same shard, so querying one user's posts reads one machine.
Choosing the right shard key matters. A key that spreads records evenly keeps each shard at a similar size and load, whereas a key such as the creation date sends all new writes to one shard. The Database Partitioning lesson covers shard keys and their trade-offs.
Grasping the building blocks ("the lego pieces")
This part of the guide will focus on the various components that are often used to construct a system (the building blocks), and the design templates that provide a framework for structuring these blocks.
Core Building blocks
At the bare minimum you should know the core building blocks of system design
- Scaling stateless services with load balancing
- Scaling database reads with replication and caching
- Scaling database writes with partition (aka sharding)
- Scaling data flow with message queues
System Design Template
With these building blocks, you will be able to apply our template to solve many system design problems. We will dive into the details in the Design Template section. Here’s a sneak peak:

Additional Building Blocks
Additionally, you will want to understand these concepts
- Processing large amount of data (aka “big data”) with batch and stream processing
- Particularly useful for solving data-intensive problems such as designing an analytics app
- Achieving consistency across services using distribution transaction or event sourcing
- Particularly useful for solving problems that require strict transactions such as designing financial apps
- Full text search: full-text index
- Storing data for the long term: data warehousing
On top of these, there are ad hoc knowledge you would want to know tailored to certain problems. For example, geohashing for designing location-based services like Yelp or Uber, operational transform to solve problems like designing Google Doc. You can learn these these on a case-by-case basis. System design interviews are supposed to test your general design skills and not specific knowledge.
Working through problems and building solutions using the building blocks
Finally, we have a series of practical problems for you to work through. You can find the problem in /problems. This hands-on practice will not only help you apply the principles learned but will also enhance your understanding of how to use the building blocks to construct effective solutions. The list of questions grow. We are actively adding more questions to the list.