System Design

Add New Chapter

Tutorial

Steps in System Design Problem

Step-1: Features
  • Define the minimum viable product. Identify the necessary features and luxury to have features.
  • Example:- Messenger System
    • Necessities are: One-to-One chat, both parties are able to read and write the message.
    • Luxuries can be: Group chat and security around it.
  • We need to figure these out with the product owners about which features they actually care about and which they don’t.
Step-2: Defining APIs
  • Now that we are set on the features, we need to figure out what are the APIs which are going to implement those features.
  • What are those APIs?
  • Who is going to call those APIs?
  • How are they going to call those APIs?
  • We need to figure out all of them.
STep-3: Availability
  • Now that we have come up with service, we need to figure out how available these services should be?
  • Example:- What if a host went down will the service still be available or even worse what if entire data-center went down will the service still be available?
  • Need to figure out how much availability they care about in the system?
Step-4: Latency Performance
  • If it is a background job we don’t care much about the latency but if it is a customer-facing request then we want system to be super-fast.
  • Based on the requirements we might want to add a cache and things like that to improve the latency.
  • Need to figure out the latency aspect from the product owners and need to take care while designing the system.
Step-5: Scalability
  • We have designed a service and it works for 100 users but will it work for thousand users or 1Million users.
  • Is it going to scale as we add more users or more requests.
  • Is it going to have the good latency performance and availability as we add more and more users.
  • Need to figure out and take care while designing the system.
Step-6: Durability
  • It might be important in some cases and might not be important in others.
  • Durability is the fact that the data can be stored in a database securely and data is not lost and it is not compromised.
  • Sometimes its okay to say that hey I will use this database and it will do all the job for me.
  • But in some cases when we need to design the database, durability plays the central role and we need to make sure the system is durable enough.
Step-7: Class Diagrams
  • Sometimes we get a problem like “Design a Parking Lot” or “Design an Elevator System”.
  • In these cases it’s important how we design the class and what are some object-oriented principles we use to solve those problem.
Step-8: Security and Privacy
  • In many case we don’t care about this initially.
  • But in cases in which we get a situation like “Design an Authentication System” the security and privacy plays a central role.
Step-9: Cost Effectiveness
  • Need to take care that whatever solution we suggest is cost-effective.
  • Need to explore if there is an alternate solution that is more cost-effective.
  • Need to discuss pros and cons of different solution as far as cost is considered.