0
0
LLDsystem_design~7 mins

What LLD covers vs HLD - Architecture Trade-offs

Choose your learning style9 modes available
Problem Statement
When designing software, teams often get confused about what details to include at different stages. Without clear separation, designs become either too vague to implement or too detailed to manage, causing delays and errors.
Solution
High-Level Design (HLD) focuses on the big picture, showing system components and their interactions. Low-Level Design (LLD) zooms in to detail how each component works internally, including classes, methods, and data structures. This separation helps teams plan broadly first, then implement precisely.
Architecture
┌───────────────┐          ┌───────────────┐
│   High-Level  │          │   Low-Level   │
│    Design     │          │    Design     │
│               │          │               │
│ - System      │          │ - Classes     │
│   Components  │          │ - Methods     │
│ - Interactions│─────────▶│ - Data Structures│
└───────────────┘          └───────────────┘

This diagram shows HLD defining system components and their interactions, which then guide the detailed LLD of classes and methods.

Trade-offs
✓ Pros
Separates concerns: HLD manages overall architecture, LLD handles implementation details.
Improves communication: stakeholders see big picture, developers get precise instructions.
Facilitates parallel work: teams can work on different modules with clear boundaries.
✗ Cons
Requires extra effort to create two design levels.
If not synchronized, LLD may drift from HLD causing integration issues.
May slow down initial development due to detailed planning.
Use when building medium to large systems with multiple teams or complex components needing clear structure.
Avoid for very small projects or prototypes where detailed design overhead outweighs benefits.
Real World Examples
Amazon
Amazon uses HLD to define services like order processing and inventory, then LLD to specify class structures and APIs within each service.
Uber
Uber applies HLD to map out rider-driver matching system components, and LLD to design algorithms and data models for each component.
LinkedIn
LinkedIn creates HLD diagrams for social graph services, then LLD documents the internal data handling and caching mechanisms.
Alternatives
Unified Design
Combines high-level and low-level details in a single design document without clear separation.
Use when: Choose when project size is small and team is tight-knit, reducing overhead.
Agile Emergent Design
Starts with minimal design and evolves details during development rather than upfront HLD and LLD.
Use when: Choose when requirements are unclear or rapidly changing.
Summary
High-Level Design shows the overall system structure and component interactions.
Low-Level Design details the internal workings of each component like classes and methods.
Separating HLD and LLD improves clarity, communication, and development efficiency.