Building Blocks: the combination of Storage and Tasks that achieves a single purpose

Foundations of Practical System Design

System Design Course for Junior Engineers

Kay Ashaolu

Lesson Overview

  • We will define what a Building Block is and how it can be used in system design architecture.
  • We will discuss in this lesson how Storage and Task units can combine into a Building Block.
  • Lastly, we will note how using Building Blocks develops your "Senior level intuition."

Motivation

  • We started with the idea that everything in computing reduces to zeros and ones.
  • These bits can represent storage (e.g., numbers, text, structures) or tasks (instructions to execute).
  • Understanding how we combine storage and tasks is key to building robust systems.

From Bits to Data Structures

  • Zeros and ones can form:
    • Lists, arrays, dictionaries, trees, graphs, and more complex structures.
  • Data structures let us organize information and define relationships.
  • We are defining a unit that employs data structures as a Storage unit.

From Bits to Instructions

  • Zeros and ones also represent instructions for CPUs and GPUs.
  • Instructions are executed, turning raw data into processed results.
  • Functions, methods, and services are all examples of instruction sets.
  • We are defining a unit that defines and executes instructions in this manner a Task Unit.

Bridging Storage and Tasks

  • A “Building Block” is a conceptual unit combining:
    • Storage: Stored values, often structured in meaningful ways.
    • Tasks: Instructions, or functions that process or transform the data.
  • This combination creates reusable, purposeful units that form the backbone of applications.

Why Building Blocks Matter

  • Building blocks represent familiar and meaningful components (e.g., user services, payment gateways, search engines).
  • They mirror real-world logic: each component holds its own data and behavior.
  • By composing multiple building blocks, we create complex, stable, and intuitive systems.

Example: A Simple Web Server

  • Let's say we want to design a Simple Web Server system.
  • It continuously runs, waiting for incoming requests, and returns a raw file (e.g. HTML, Images).
  • When a request arrives, it uses storage (url paths) and tasks (instructions to generate responses) to produce the desired output.
  • A Simple Web Server can be represented as two Building Blocks working together:
    • A server, and
    • A filesystem

Server Internals: Storage as Routing Tables

  • We can think of a server as initially employing a Storage unit utilizing a key/value pair (or dictionary):
    • Keys: URL paths (e.g., "/", "/posts/1", "/posts/2").
    • Values: References to Task units that are associated with those paths.
  • The server maps keys (paths) to the correct handling logic (Task units).

Server Internals: Tasks as Request Handlers

  • Each URL path maps to a specific Task unit.
  • When the server receives the "/posts/1" key, it:
    • Looks up the Task unit for "/posts/1".
    • Executes that function with the request details.
    • Returns the appropriate response.

Filesystem Internals: Storage as Filesystem

  • A Task unit from the Server Building Block  then interacts with a Filesystem Building Block 
  • A Filesystem Building Block:
    • Utilizes a Tree Storage Unit.
    • Provides systems the ability to pass in the actual file path to a file (e.g. /public_html/posts/1.html) 
    • The node that is connected to that path contains the raw 0's and 1's for that file.
    • This is passed to the Task unit, which then returns it to the system that sent the request to the server.

Diagram of the Server Building Block

Diagram of the File System Building Block

Diagram of the Simple Web Server

Building Blocks Interacting

  • In summary a static web server can be modeled using two Building Blocks:
    • A server (handles requests),
    • A filesystem (provides access to raw file data)

Note: No specific technologies mentioned

  • This is intentional and will remain so for this course
  • The critical insight that Senior engineers have is that technologies come and go, but the core principles of what you need do not change
  • Understanding these core principals are crucial to building that "Senior level intuition"

Buliding Blocks as Intuition

  • This course aims to add a third fundamental pillar to your toolbelt.
    • 1)  Data Structures (employed by Storage Units)
    • 2) Algorithms (employed by Task Units)
    • 3) Modules/Components (employed by Building Blocks)
  • This course aims to accelerate the growth of your intuition by defining and describing technology agnostic Building Blocks and providing several Case Studies where they are employed.

Building Blocks as Architecture

  • By combining technology agnostic Building Blocks, we can assemble entire architectures.
  • The intuition: deeply understand the Building Blocks at your disposal, what are their strengths and weaknesses, and what combination of Storage and Task units they consist of.
  • This helps in debugging, scaling, and evolving the system over time.

Gaining Intuition

  • By seeing how Storage and Task units unite in a Building Block, you learn:
    • How systems are structured.
    • How different services communicate.
    • Why certain patterns and decisions are made at the architectural level.

Summary & Next Steps

  • We’ve introduced the concept of a “Building Block” as Storage and Tasks units serving a purpose.
  • This idea helps to understand how complex systems are composed of simpler components.
  • Next, we’ll explore how to identify, design, and integrate these building blocks effectively.

Building Blocks: combining Storage and Tasks into a functional unit

By kayashaolu

Building Blocks: combining Storage and Tasks into a functional unit

  • 4