You can support this website with a contribution of your choice.
When making a contribution, mention your name, and programguru.org in the message. Your name shall be displayed in the sponsors list.
When we build a software system, it's not just about writing code. It begins with designing the system. Design is usually split into two main phases: High-Level Design (HLD) and Low-Level Design (LLD). Understanding these two helps developers and architects break down complex systems into manageable components.
High-Level Design (HLD) provides a broad overview of the system. It describes how the system will be divided into different components or modules and how these components will interact with each other. HLD is more about what needs to be done and how the different parts are connected.
Let's consider designing a basic ride-booking app like Uber.
High-Level Components:
In an HLD diagram, we would show these components and draw arrows to indicate how they talk to each other. For example, when a user books a ride, the Ride Booking Service may communicate with the User Service and Payment Service before sending a confirmation through the Notification Service.
Question: At the HLD stage, do we decide whether we use Python or Java?
Answer: No. HLD does not focus on language-level decisions. It deals with how the system components are organized, not how they are implemented.
Low-Level Design (LLD) dives into the internal structure of each component defined in HLD. It answers the question: How will we implement each piece of the system?
Continuing with the ride-booking app example, let’s look deeper into the Ride Booking Service component.
Low-Level Design Details:
RideService
class with methods like requestRide()
, cancelRide()
, assignDriver()
RideRepository
class to interact with the databaserides
, users
, drivers
This level of design might also specify that we use Spring Boot in Java and PostgreSQL for storage. It defines how the Ride Booking Service’s logic is written and how it accesses or updates data.
Question: Is LLD like writing code?
Answer: It's one step before coding. In LLD, you plan every detail so that when coding starts, developers just follow the blueprint.
Aspect | High-Level Design (HLD) | Low-Level Design (LLD) |
---|---|---|
Purpose | Defines architecture and modules | Defines internal logic of modules |
Detail Level | Abstract | Detailed |
Audience | Architects, Stakeholders | Developers |
Examples | Service interactions, data flow diagrams | Class diagrams, method specs, DB schema |
Technology Decisions | Broad level | Specific frameworks/libraries |
In a real-world project, HLD is done first to define the system scope and design. Once the HLD is finalized, each module is passed on for LLD, where developers and technical leads define how to build it step by step.
Why do we need both HLD and LLD? Can't we just jump to coding with a good plan?
Answer: Without HLD, we may not understand how different modules will work together. Without LLD, implementation will be inconsistent or incomplete. Together, they ensure structure and clarity at all stages of development.
Think of a simple application like a to-do list app. Try to write down:
Doing this exercise helps build the habit of separating concerns and designing systems step by step.
You can support this website with a contribution of your choice.
When making a contribution, mention your name, and programguru.org in the message. Your name shall be displayed in the sponsors list.