DEV Community

Daniel Kuboi
Daniel Kuboi

Posted on

Understanding System Design

In this article we will go through the process involved when designing scalable systems. Here are some questions for designing that should be answered before moving on to the next steps:

  1. Will users be able to use post request faster
  2. Will users of our service be able to post tweets and follow other people?
  3. Should we also design to create and display the user’s timeline?
  4. Will tweets contain photos and videos?
  5. Are we focusing on the backend only or are we developing the front-end too?
  6. Will users be able to search tweets?
  7. Do we need to display hot trending topics?
  8. Will there be any push notification for new (or important) tweets?

The next step will be to define what APIs are expected from the system. This will not only establish the exact contract expected from the system, but will also ensure if we haven’t gotten any requirements wrong.
It is always a good idea to estimate the scale of the system we’re going to design. This will also help later when we will be focusing on scaling, partitioning, load balancing and caching.

  1. What scale is expected from the system
  2. How much storage will we need?
  3. What network bandwidth usage are we expecting? This will be crucial in deciding how we will manage traffic and balance load between servers. Next is defining data models early will clarify how data will flow among different components of the system. Later, it will guide towards data partitioning and management. how they will interact with each other, and different aspect of data management like storage, transportation, encryption, etc. Which database system should we use? Will NoSQL like Cassandra best fit our needs, or should we use a MySQL-like solution? What kind of block storage should we use to store photos and videos? Next step is implementing a high level design where you draw 5 – 6 core components of the applications

The next step will be defining detailed design on specific areas or components of the application, and also providing the PROS and CONS for why you prefer certain approach over the other
The tradeoffs maybe:

  1. Should we partition our data to distribute it to multiple databases? Should we try to store all the data of a user on the same database? What issue could it cause?
  2. Should we try to store our data in such a way that is optimized for scanning
  3. How much and at which layer should we introduce cache to speed things up?
  4. What components need better load balancing?

Identifying and resolving bottlenecks is also critical in designing scalable systems, this help in developing system that is fault tolerant and can survive under critical conditions

  1. Is there any single point of failure in our system? What are we doing tomitigate it?
  2. Do we have enough replicas of the data so that if we lose a few servers we can still serve our users?
  3. Similarly, do we have enough copies of different services running such that a few failures will not cause total system shutdown?
  4. How are we monitoring the performance of our service? Do we get alerts whenever critical components fail or their performance degrades?

Top comments (0)