High Level Design (HLL) vs Low Level Design (LLD)
π§© HLD vs LLD in Software Design
Both HLD (High-Level Design) and LLD (Low-Level Design) are crucial steps in software architecture, but they serve different purposes and audiences.
π· 1. HLD β High-Level Design
Purpose:
Provides a macro-level overview of the system. It focuses on what needs to be built and how components interact.
| Attribute | Description |
|---|---|
| Audience | Architects, Tech Leads, Clients |
| Scope | Overall system architecture, module breakdown |
| Focus | System structure, external integrations, major components |
| Details Include | Microservices, databases, APIs, data flow, technology stack |
| Output | Diagrams: Component Diagram, Deployment Diagram, Data Flow |
Β
β Β Analogy: Blueprint of a building
πΉ 2. LLD β Low-Level Design
Purpose:
Describes the internal logic and structure of each component/module. It focuses on how to implement the design.
| Attribute | Description |
|---|---|
| Audience | Developers |
| Scope | Individual classes, methods, interfaces |
| Focus | Code structure, logic, algorithms, database schemas |
| Details Include | Class diagrams, sequence diagrams, database tables, pseudo-code |
| Output | Diagrams: Class Diagram, Sequence Diagram, ER Diagram |
Β
β Β Analogy: Internal wiring and plumbing of the building
βοΈ Side-by-Side Comparison:
| Feature | HLD | LLD |
|---|---|---|
| Level | Abstract / Architectural | Detailed / Implementation |
| Granularity | System-wide | Component/module specific |
| Documentation | Architecture docs, service flow | Class/method logic, data schemas |
| Tools Used | Lucidchart, Draw.io | UML tools, VS Code, IDE docs |
π‘ Example (for a Video Streaming App):
| Layer | HLD | LLD |
|---|---|---|
| API | RESTful service endpoints defined | Method signatures, validations, routing |
| Storage | Use S3 + PostgreSQL | Table schema, object key naming strategy |
| Video Pipeline | Encode > Transcode > Serve | FFMPEG command flow, retry logic, queues |