Buildfest Learn System DesignRead and experiment freely · Chapter activities stay in this tab
Practice librarySystem DesignSystem design foundations

LESSON 01 • SYSTEM DESIGN

System design foundationsStart with a user need.
Build the system around it.

System design foundations. Learn the concepts, explore a model and defend your design.

DEFINITION

System design is the process of deciding how software components, data and communication work together to satisfy a user need under stated constraints. It includes normal behavior, heavy demand, security, failure and recovery. A design is successful when its decisions support the required outcome, not when its diagram contains many technologies.

The three responsibilities of a basic system
  1. STEP 1ClientCollects a request
  2. STEP 2ApplicationChecks business rules
  3. STEP 3DatabaseRemembers accepted state

The screen, decision-making code and durable record have different jobs.

CONCEPT 1

A simple app is already a system

Start with something you know

Imagine a college canteen app. A student sees the menu, places an order and receives an order number. The screen is only one part of the system. Something must receive the order, check the price, remember it and tell the kitchen. System design means deciding how these parts work together, especially when many people use the app or one part stops working.

The basic building blocks

The client is the part asking for work: usually a browser or mobile app. The server is a program that receives requests and produces responses. It usually runs on a computer in a data centre, but you can also run one on your laptop. The database remembers information beyond the life of one request, such as orders and student accounts. The network carries messages between these parts.

Where computer resources fit

The CPU performs computation. RAM is fast working memory, but a process losing its memory should not erase accepted orders. Durable storage keeps data under the storage system's stated guarantees. Network links move bytes and can be slow or unavailable. A design often becomes slow because one of these resources has more work than it can handle.

CONCEPT 2

Follow one order through the system

Request and response

A request is a message asking for an action or information. When Riya taps Place order, the app sends the selected items and an operation identifier to the server. The server checks the request, determines the price using its own trusted data, records the order and returns an order number. The response tells the app what happened. A request may fail before reaching the server, while being processed, or while its response travels back.

Stateless does not mean forgetful

A stateless application instance does not depend on private memory from a previous request to understand the next one. It can read durable information from a database or another shared store. This makes it easier to send a later request to another healthy server. A stateful connection or session is sometimes useful, but its recovery and routing need a deliberate plan.

One app can serve many students

A server can have several requests in progress. Concurrency means making progress on overlapping tasks; it does not necessarily mean all instructions run at the exact same instant. Waiting for a database can leave time for another request. The number of requests a server can handle depends on work per request, hardware, software and dependencies. There is no universal requests-per-server number.

One order has a request and a reply
  1. STEP 11. StudentSend order + operation key
  2. STEP 22. ApplicationValidate and commit
  3. STEP 33. StudentReceive order number

The reply follows the commit. A missing reply does not prove that the order was rejected.

CONCEPT 3

Decide what the app must do

Functional requirements

These describe actions the system must support. For the canteen, students can browse a menu, place an order and check its status. Staff can mark an order ready. Ask what is in scope before choosing tools. Payments, delivery tracking and recommendations are separate features unless the problem includes them.

Quality requirements and constraints

A quality requirement describes how well an action should work. For example: most menu reads should finish within an agreed time under a stated workload; accepted orders must survive a specified failure. A constraint is a limit such as a monthly budget, an existing database or a two-person team. Words such as fast and scalable need a measurable definition before they can guide a design.

An invariant is a rule that must stay true

For example, one payment must not create two orders, and one student must not read another student's private receipt. These rules matter during normal use and during failures. Write them before drawing infrastructure. If an interviewer says the system has to handle many users, ask how many, which actions are frequent and what can be delayed.

Requirements become design decisions
  1. CONCEPTActionPlace an order
  2. CONCEPTQualityResponse target at stated load
  3. CONCEPTInvariantOne operation, one order

A feature says what happens; a quality target says how well; an invariant says what must stay true.

CONCEPT 4

From requirements to a first design

High-level design

High-level design, often shortened to HLD, shows major parts and their responsibilities. Start with a client, an application server and a database. Explain the read and write paths in words. Add a cache, queue or second service only when you can name the problem it solves. A small complete design is easier to check than a large drawing full of unexplained boxes.

Low-level design

Low-level design, or LLD, explains how one part works inside. For an order module, this could include the Order data model, allowed status changes and the reserveStock function. HLD asks where responsibilities live. LLD asks how those responsibilities are implemented safely. Both levels matter, and interviews may emphasize one more than the other.

Why begin with a modular monolith

A monolith is one main application deployment. Modular means its code still has clear areas such as accounts, menu and orders. This can be a practical starting point for a small team. Microservices split selected responsibilities into separately deployed services. That may help independent teams or scaling, but introduces network failures, deployment work and harder coordination between data owners.

Zoom from HLD to LLD
  1. STEP 1HLDClient, API and store
  2. STEP 2API contractInputs, results and errors
  3. STEP 3LLDState transitions and rules

Zooming in adds detail without changing the user outcome the design must support.

Key learning points

  • Identify the user and the operation before selecting a database or framework.
  • A client asks for work; an application handles it; an authoritative store keeps the accepted records.
  • Functional requirements describe actions. Quality requirements describe measurable behavior.
  • An invariant is a rule that must remain true during concurrency and failures.
  • HLD explains the major parts. LLD explains interfaces, internal rules and state transitions.

Compare the important ideas

System design foundations: concepts and trade-offs
TermPlain meaningCanteen example
Functional requirementAn action the user can performPlace an order and see its status
Quality requirementHow well an action must workA stated fraction of valid orders meets a response target
ConstraintA limit the design must respectTwo developers and an existing database
InvariantA rule that must remain trueA paid operation must not create two orders
Non-goalAn explicitly excluded featureNo delivery tracking in version one

WORKED EXAMPLE

Build the smallest complete design

The app sends item identifiers and a stable operation ID to an order API. The API derives the student identity from authentication, reads trusted prices and records an order. It returns the durable order number after the stated acceptance condition is met. A later staff request changes status using an allowed transition. For a small first release, one modular application and one relational database can meet these needs without a queue or several separately deployed services.

Further reading

Original teaching explanations by Buildfest Learn. Check these primary references for the underlying concepts and implementation details.