System Design 101: Building Scalable Architectures with Drawbot

Hello everyone! In this post, we are going to have a very brief introduction to system design and why it matters more than just coding. We'll explore the core pillars of a robust system and look at real-life examples using Drawbot to understand how system design works in practice.

Watch the video: System Design Explained

Coding vs. System Design

Let's start with a reality check. We've all built applications in the past, but the moment we put them into production, we understand the real value of system design. Why is it so important? Because as traffic increases on our application, we often find ourselves unable to fulfill requests, or our system isn't active all the time.

In a nutshell: Coding is like crafting bricks, and system design is like architecting the entire building.

We need both. Without the architecture, we can't do anything meaningful with the bricks.

The Four Pillars of System Design

There are four main pillars you need to consider when designing a system:

  1. Scalability: It doesn't matter whether you have 100 users or 100 million users; your system should be capable enough to scale.
  2. Reliability: If I'm providing APIs and users can't access my service—say, my API is down 40% of the time—that means I have a really poor system design.
  3. Performance: The system should deliver content fast. We can utilize mechanisms like caching, load balancing, CDNs, and database optimization to ensure fast read and write operations.
  4. Cost Optimization: A poor system design means losing a lot of money. It's pretty straightforward.

Bad vs. Good Architecture

By now, you should be able to understand what constitutes a bad architecture.

  • Bad Architecture: Becomes a bottleneck as traffic increases. You can't predict response times, and it usually crashes during traffic peaks.
  • Good Architecture: Has fallback mechanisms. If one part fails, it shifts to a different server. It can manage a high volume of requests, has predictable delivery times, and is capable of serving 2x or 3x the load it was built for.

Big tech companies prioritize system design skills. If you are applying for a software development or senior architect role, over 40% of recruiters prioritize system design. Any developer can write code, but very few can build applications that serve millions of users.

Visualizing System Design with Drawbot

To better understand these concepts, let's look at an example using Drawbot, a minimal application I built where you can generate diagrams with AI.

For instance, if we ask "How does system design work?", we can generate a sequence diagram to visualize the process. Before writing code, there are a lot of things we need to understand. System design initiates with requirements, then defines the architecture, and only then do we start implementation.

Here is a visualization of that flow:

System Design Requirements Gathering Architecture Design Implementation Testing Deployment Initiates Defines Guides Undergoes Prepares for
System Design Requirements Gathering Architecture Design Implementation Testing Deployment Initiates Defines Guides Undergoes Prepares for

As you can see, implementation is not at the top of our list. It follows requirements and architectural design.

A Simple Path to Learning System Design

System design is a vast domain, but here is a simple path you can follow:

  1. Learn Fundamentals: Understand scalability, availability, and the CAP theorem.
  2. Understand Building Blocks: Cover load balancing, caching, and good database strategies.
  3. Study Architectural Patterns: Learn how different systems are structured.
  4. Analyze Existing Applications: Take references from standard, efficient applications like Twitter, YouTube, or Uber.
  5. Read Case Studies: Get insights from published case studies.
  6. Start Building: Apply what you've learned.

The bottom line is, whether you are writing code or not, system design is going to help you think better. It will make you a better engineer, help you solve problems faster in unique ways, and open doors for better job roles.

If you want to explore more diagrams like the one above, check out Drawbot and start visualizing your systems today!