Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

What is System Design?

System design is the process of defining how different parts of a software system interacts to meet both functional and non-functional requirements.

Key components of a system

A typical software system can be broken down into several key components:

  • Client - The part of the system with which the user interacts. It is responsible for displaying information, collecting user input and communicating with the backend.
  • Server - The backend handles the core functionality of the system. It processes incoming requests, executes business logic, interacts with databases and other services, and send requests back the client.
  • Databases - This is responsible for storing and managing data. It can be of various types such as relational/non-relational database, in-memory database, distributed object storage systems, etc.
  • Networking Layer - This include components like load balancers, API’s, communication protocol that ensure reliable and efficient interaction between different part of system
  • Third-Party Services - These are external API’s or platform that extend the system’s capabilities such as payment processors, email or sms services, authentication services, etc.

Process of System Design

System design is a step by step process that starts with understanding the requirements and ends with a detailed blueprint.

1. Requirement Gathering

This includes asking question about the requirements of the product which include:

  • Functional Requirements
  • Non-Functional Requirements
  • Number of users expected
  • Expected data volume, traffic patterns
  • Constraints such as budget, compliance rules, etc

2. Making Approximate Calculations

This involves making approximation about the number of resources would be needed.

  • Data size
  • Requests per second
  • Bandwidth needs
  • Number of resources required

3. High Level Design

Now that we have an overview of what our system will need, we can create a visual or high level design of the system’s components and how they interact with each other. This includes:

  • The main modules and services
  • Data flow between them
  • External Dependencies (eg. third-party API’s, external databases)

4. API Design

Once the high level design is done, we can move on to define the components in detail such as:

  • Type of database used
  • Schema, tables and relationships
  • Design API’s for services.

5. Deep Dive

Here we zoom into each component and define:

  • Internal logic, caching, concurrency handling
  • Scaling strategies
  • Replication, partitioning and fault tolerance
  • Availability, reliability, latency
  • Non functional requirements

6. Identify Bottlenecks and Trade-offs

In this phase we see the bottlenecks of our designed systems and the trade-offs we made. We make sure to try to eliminate bottlenecks if reasonable and important and reduce and justify the trade-offs if made in the desing.