Topic 012 / Core
High-level design (HLD)
Chapter 2.1 · What System Design Is
What and why
Jumping straight to class names or table columns locks in structure before anyone agreed what the major pieces even are. High-level design (HLD) is the architecture view of a system: its major components, the data flow between them, technology categories, and deployment topology — aimed at an audience (other engineers, architects, stakeholders) that needs the shape of the system, not every method signature. Builds on: → 11.
Diagram
Client ──► API Gateway ──► Order Service ──┬──► Database
│ └──► Cache
Payment Service
Four boxes, each with one responsibility, and the arrows showing who talks to whom — that is a complete HLD for a small system.
How it works
- List the major components implied by the functional requirements (→ 15).
- Draw the data flow between them for the critical use cases (→ 18).
- Pick technology categories, not vendors yet ("a relational database," not a specific product).
- Decide the deployment topology: how many tiers, and where state lives.
- Stop before class names, method signatures, or schema columns — that level of detail is LLD (→ 13).
Practical example
An e-commerce checkout at HLD level: Client → API Gateway → Order Service (talks to Database and Cache) and Payment Service. The diagram above is the example — it answers "what are the pieces and how do they connect" without naming a single class.
When to use it
- Use when: a system has more than one component, or more than one person building it.
- Avoid when: the whole system is one file run by one person — a diagram adds no information a comment wouldn't.
- Failure scenarios: agreeing on a database schema before agreeing on component boundaries, then redrawing the schema when the boundaries turn out wrong.
- Simpler alternative: for a trivial system, a one-paragraph description of the pieces replaces a formal diagram.
Practice
(Mechanism kind — trace/build a small version; 20 min, no lab services). Draw the HLD for a URL shortener: identify its components (API, hashing logic, database, cache, redirect handler) and draw two separate flows — "create a short URL" and "resolve a short URL." Done when every box has exactly one responsibility and no box silently does two unrelated jobs.
Key takeaway
HLD names the pieces and their connections before any piece is detailed. Done when you can draw one from a one-paragraph problem statement in under 10 minutes. Used next in → 13 (LLD detail), → 14 (architecture fundamentals).
References
None — this topic makes no external claims.
Source directory