What low-level design is (and is not)
What you will learn on this page
Section titled “What you will learn on this page”- The difference between low-level design, application architecture, and high-level distributed design.
- How the same problem produces different questions at each level.
- How to recognise when a system-level fact changes the design of your classes.
- What low-level design is often mistaken for.
Three levels of design
Section titled “Three levels of design”Software design happens at several scales. This site uses three names for them. Other books and companies draw the lines a little differently, so treat these as working vocabulary, not official definitions.
High-level design (often called system design) decides how a whole system is split across processes and machines: which services exist, where data is stored, how parts communicate over a network, and how the system scales and survives failures. Its building blocks are services (separately running programs), databases, message queues (which hold messages until a receiver takes them), and caches. See High-level design.
Application architecture decides how one program (one deployable application or service) is divided into large parts: layers, modules, and components, and the rules about which part may depend on which. Its building blocks are modules and their interfaces. See Application architecture.
Low-level design decides the inside of those parts: the classes, interfaces, functions, data structures, and object interactions, who owns each object, and how errors are reported. Ownership means responsibility for ending an object’s life and releasing what it holds; the C++ section teaches it in detail. Its building blocks are types and functions. See Low-level design.
Text description of the diagram
Three nested boxes; every arrow means “uses”. The outer box is high-level
design, the whole system: a web front end uses the loan service, and the loan
service stores data in a database. The middle box, application architecture, is
inside the loan service: an HTTP API module uses the loan domain module, which
uses a storage module, which uses the database. The inner box, low-level design,
is inside the loan domain module: LoanPolicy uses Member and Loan (it reads
the member and the member’s loans to decide whether a new loan is allowed). Each
level is the inside of one part of the level above it.
Diagram source (Mermaid)
flowchart TB
subgraph HLD[High-level design: the whole system]
Web[Web front end]
subgraph App[Application architecture: inside the loan service]
Api[HTTP API module]
subgraph LLD[Low-level design: inside the loan domain module]
LoanPolicy --> Member
LoanPolicy --> Loan
end
Api --> LLD
LLD --> Store[Storage module]
end
Web --> App
Store --> DB[(Database)]
endOne problem, three sets of questions
Section titled “One problem, three sets of questions”Take a single request: “Members should be able to borrow books from the library, with a limit on how many they can hold at once.” Here is what each level asks about it.
High-level design questions
- How many members and loans per second must the system handle?
- Is there one central database, or one per library branch?
- What happens if the loan service is down; can the front desk still lend books?
Application architecture questions
- Which module owns the loan rules, and which module talks to the database?
- May the domain module depend on the database code, or only on an interface?
- Where is input from the network validated?
Low-level design questions
- Is “loan limit” a property of the member, the member’s membership type, or a separate policy object?
- What object answers “may this member borrow this book now?”, and what does it need to know?
- Who creates a
Loan, who owns it, and what happens to it when the book is returned? - How does a caller learn that a loan was refused, and why?
A rough sketch of what each level produces makes the difference concrete. The sketch below is text, not code to compile.
IllustrativeA fragment for explanation; not compiled on its own.
High-level design services: web front end, loan service, notification service data: loans database (replicated), message queue for reminders
Application loan service modules:architecture api/ -> depends on domain/ domain/ -> depends on nothing outside itself storage/ -> implements domain's LoanRepository interface
Low-level design domain/: class LoanPolicy { can_borrow(member, book) -> Decision } class Loan { book id, member id, due date; return_book() } interface LoanRepository { find_active(member), save(loan) }The levels are connected. The LoanRepository interface appears at two levels:
architecture decides that the domain module must not depend on storage code, and
low-level design decides exactly what that interface looks like.
When system concerns change a local design
Section titled “When system concerns change a local design”Most of this site works at the low-level design level and mentions system-level concerns only when they change local decisions. That happens more often than you might expect. Three examples:
- Several copies of the service run at once. If two copies can handle requests for the same member at the same moment, a check like “count this member’s loans, then add one if under the limit” can let both requests through. A lock inside one process cannot prevent that, because the other copy is a different process. The class design must change: the repository interface may need an operation that checks and saves in one step, letting the database enforce the rule (for example, inside a transaction or with a constraint).
- Messages may be delivered twice. If reminder messages travel through a queue that may deliver a message more than once, the handler class must be safe to run twice for the same message (for example, by remembering which message IDs it has already handled).
- A network call sits behind an interface. If
LoanRepositorywill one day be backed by a remote service, an interface with one call per loan may be too slow for a member with many loans. Designing it to fetch all active loans for a member in one call is a low-level decision driven by a system fact.
In each case the system-level fact becomes a requirement for the low-level design. The Requirements section teaches how to discover such facts by asking questions instead of guessing.
What low-level design is not
Section titled “What low-level design is not”- Not drawing diagrams for their own sake. Diagrams are tools for thinking and explaining. A design exists in the code and in the reasons behind it.
- Not applying as many patterns as possible. A design pattern is a response to a specific problem. Using one where the problem is absent adds code and indirection without benefit.
- Not C++ language trivia. Knowing obscure language rules is useful, but the questions here are about responsibilities, dependencies, ownership, and change.
- Not a one-time activity. A design changes as requirements change. Part of low-level design is keeping the code easy to change in the directions that are likely.
Where the lines blur
Section titled “Where the lines blur”The three levels are a way of organizing questions, not separate jobs. On a small team, one person may answer all three in an afternoon. In a small program with a single module, application architecture may be one sentence long. And some decisions sit on a boundary: the shape of a module’s public interface is both an architectural decision (what the module promises) and a low-level one (which types and functions express that promise).
What matters is noticing which kind of question you are answering, so you can choose the right tools and stop at the right level of detail.
Exercise: Classify eight design questions
For each question, decide whether it is mainly a high-level design, application architecture, or low-level design question. Some sit on a boundary; say which levels and why.
- Should reservation requests go through a message queue so that a slow database does not block the web front end?
- Should
Reservationstore aMemberobject, or only the member’s ID? - May the reporting module read the reservation tables directly, or must it go through the reservation module’s interface?
- How many database replicas (copies) do we need to survive the loss of one data center (one building full of servers)?
- Should the fee calculation return an error value or throw an exception when a member’s account is closed?
- Should the system be split into separate services for loans and for payments?
- Which class decides whether a book can be renewed:
Loan,Member, or a separateRenewalPolicy? - The reservation handler may receive the same request twice after a network retry. How should its class prevent creating two reservations?
Show the explained answer
- High-level design. It is about how processes communicate and how load affects availability, across machines.
- Low-level design. It is about the data a class holds and the ownership
and lifetime consequences: storing a whole
Membercopy can go stale, while storing an ID requires a lookup. - Application architecture. It is a rule about which module may depend on which inside one application.
- High-level design. Replication and failure of data centers are system-wide concerns.
- Low-level design. It is a failure contract for one function, decided at the level of types and signatures. (If the choice becomes a rule for every module, it is also an architectural convention.)
- High-level design, assuming “services” means separately deployed programs: splitting them changes process and network boundaries. If the question meant two modules inside one application, it would be an application architecture question.
- Low-level design. It is responsibility assignment: which object owns a rule.
- Boundary: high-level fact, low-level design. Duplicate delivery comes from the system (network retries); the fix is designed at the class level. For example, each request carries a unique idempotency key, and the handler remembers keys it has already processed, so running the same request twice has the same effect as running it once. This is the “system concern changes a local design” case from this page.
Summary
Section titled “Summary”- High-level design arranges services and data across machines. Application architecture divides one application into modules with dependency rules. Low-level design shapes the classes, interfaces, and ownership inside those modules.
- Each level asks different questions about the same problem.
- System facts such as multiple running copies, duplicate messages, or network latency become requirements for the low-level design.
- Low-level design is about responsibilities, dependencies, ownership, and change, not about diagrams or pattern counts.