System Design Course for Junior Engineers
Kay Ashaolu
We will introduce seven—yes, just seven—building blocks for which we will create system designs for 15 real applications. In this lesson, we will show you their tradeoffs, strengths, and weaknesses to provide you with the base intuition to guide you through these case studies.
We will also introduce three additional "External Entities" representing critical and necessary external forces that applications must deal with.
| Type | Building Block | Icon |
|---|---|---|
| Task | Worker | |
| Task | Service | |
| Storage | Key-Value Store | |
| Storage | File Store | |
| Storage | Queue | |
| Storage | Relational Database | |
| Storage | Vector Database |
| Strength | Weakness |
|---|---|
| Efficient for long tasks | Hard to debug |
| Built With |
|---|
| Task Unit |
| What is it? |
|---|
| Workers operate independently of a user's direct interaction, performing tasks like data processing or job execution in the background |
| Strength | Weakness |
|---|---|
| Delivers requested content efficiently | Responsiveness drops with high load or slow tasks |
| Built With |
|---|
| Task Units Dictionary Storage Unit |
| What is it? |
|---|
| Services map publicly available paths to functions (task units) that centralize resources and services for specific purposes |
| Strength | Weakness |
|---|---|
| Fast and scalable | Limited query flexibility |
| Built With |
|---|
| Dictionary Storage Unit |
| What is it? |
|---|
| A key-value store is a simple database that stores data as unique key-value pairs for fast retrieval |
| Strength | Weakness |
|---|---|
| Organize and store data efficiently | Can have slower performance over time due to fragmentation |
| Built With |
|---|
| Tree Storage Unit |
| What is it? |
|---|
| A file store organizes data hierarchically using tree structures, where directories are nodes and files are leaf nodes |
| Strength | Weakness |
|---|---|
| Ensures fair and orderly processing of tasks | Can become a bottleneck if items are added faster than they are processed |
| Built With |
|---|
| Array Storage Unit |
| What is it? |
|---|
| A queue is a data structure that processes items in a first-in, first-out (FIFO) order, commonly used for tasks like scheduling and buffering |
| Strength | Weakness |
|---|---|
| Ensures data is correct and available | Massive scale is difficult |
| Built With |
|---|
| Task Unit Array and Tree Storage Units |
| What is it? |
|---|
| A relational database organizes and stores data in structured tables with rows and columns, enabling relationships between tables through keys for efficient querying and management |
| Strength | Weakness |
|---|---|
| Excels at finding similar items quickly in large datasets | Less precise and scalable for very large datasets or exact matches |
| Built With |
|---|
| Task Unit Array and Tree Storage Units |
| What is it? |
|---|
| A vector database stores and searches data as mathematical vectors, often used for finding similar items in applications like AI and recommendations |
| Entity | Description | Icon |
|---|---|---|
| User |
Represents the end user that is interacting with the system |
|
| Time |
Represents a scheduled and/or recurring external trigger |
|
| External Service |
Represents an integration to a service that is outside the system |
Here are three key tips before you jump to the next section:
We will build all 15 case studies using these seven building blocks only. External entities are used solely as necessary. If you do not fully understand any building block, return to the Fundamentals of Practical System Design section, as most building blocks will be repeated frequently throughout the 15 case studies.
Please go through the case studies in order. Later case studies refer to previous case studies to build your "Senior-level intuition" so that your mind makes the necessary connections.
In these case studies, you'll see two building blocks connected as a single entity. Note how their combinations can serve different purposes and functionalities. Understanding these connections is key to developing senior-level intuition and recognizing how the same combinations can be applied in various ways while following the same principles.
used as a Cache Service
and an Authentication Service
Example