System Design: Step-by-step - Deepstash

Explore the World's Best Ideas

Join today and uncover 100+ curated journeys from 50+ topics. Unlock access to our mobile app with extensive features.

There is no "perfect" system

There is no "perfect" system

There is no single design for any system that works perfectly. There are always trade-offs. Two different people can come up with different designs, with both being excellent given different assumptions.

Your goal is to:

  1. Understand the use case
  2. Scope the problem you are solving
  3. Make reasonable assumptions
  4. Create a solid design based on those assumptions
  5. Be open about the trade-offs you made and the weaknesses of your design

3

27 reads

Step 1: Scope the problem

Step 1: Scope the problem

You can't design a system if you don't know what you're designing.

First, ask questions to clarify what you need to implement. Then make a list of all major features and use cases that your design must cover.

For example, if you're designing TinyURL, that list might be:

  • Shortening a URL to a TinyURL
  • Analytics for a URL
  • Retrieving original URL from a TinyURL

3

7 reads

Step 2: Make reasonable assumptions

Step 2: Make reasonable assumptions

Depending on the type of system you are designing, you need to estimate its scale: how many users will access it every day, how much data you will store and process, etc.

You should be careful when making assumptions. Incorrect assumptions can dramatically change the design. You should rely on your product sense as well to make reasonable assumptions.

In the TinyURL example:

  • It matters whether newly generated URLs must be accessible immediately
  • It matters whether URL analytics must be updated in real-time

3

6 reads

Step 3: Draw the major components

Step 3: Draw the major components

Draw a high-level diagram of what your system looks like:

  • Include major components such as servers, databases and important processes
  • Describe the flow of your system from end-to-end

3

13 reads

Step 4: Identify the key issues

Step 4: Identify the key issues

Once you have a basic design in mind, focus on the key issues. Identify the bottlenecks and major challenges of the system, and then adjust your design to handle them.

In the TinyURL example, a challenge you might consider is that some URLs are frequently accessed, while others suddenly peak when they go viral on social media. You don't want to hit the database for every request, so you could add a cache layer.

3

9 reads

CURATED BY

ocpodariu

Alt account of @ocp. I use it to stash ideas about software engineering

CURATOR'S NOTE

πŸ“– Cracking the Coding Interview

β€œ

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Access to 200,000+ ideas

β€”

Access to the mobile app

β€”

Unlimited idea saving & library

β€”

β€”

Unlimited history

β€”

β€”

Unlimited listening to ideas

β€”

β€”

Downloading & offline access

β€”

β€”

Personalized recommendations

β€”

β€”

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates