<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Anurag Mahato</title>
    <description>The latest articles on DEV Community by Anurag Mahato (@anuragm23).</description>
    <link>https://dev.to/anuragm23</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4164260%2F29c5ad72-c006-4a0b-8ca6-c476b313a600.jpg</url>
      <title>DEV Community: Anurag Mahato</title>
      <link>https://dev.to/anuragm23</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anuragm23"/>
    <language>en</language>
    <item>
      <title>01_intro-to-LLD</title>
      <dc:creator>Anurag Mahato</dc:creator>
      <pubDate>Mon, 05 Oct 2026 15:28:33 +0000</pubDate>
      <link>https://dev.to/anuragm23/01intro-to-lld-2mjg</link>
      <guid>https://dev.to/anuragm23/01intro-to-lld-2mjg</guid>
      <description>&lt;h2&gt;
  
  
  Low-Level Design: Understanding the Basics
&lt;/h2&gt;

&lt;p&gt;When building a software application, we don't just need to decide &lt;strong&gt;what the system should do&lt;/strong&gt;. We also need to decide &lt;strong&gt;how the individual parts of the system will be designed and work together&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is where &lt;strong&gt;Low-Level Design (LLD)&lt;/strong&gt; comes in.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Low-Level Design?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Low-Level Design (LLD)&lt;/strong&gt; is the process of designing the internal structure of an application.&lt;/p&gt;

&lt;p&gt;It focuses on things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Classes and objects&lt;/li&gt;
&lt;li&gt;Relationships between objects&lt;/li&gt;
&lt;li&gt;Responsibilities of each class&lt;/li&gt;
&lt;li&gt;Data flow&lt;/li&gt;
&lt;li&gt;Interfaces&lt;/li&gt;
&lt;li&gt;Implementation decisions&lt;/li&gt;
&lt;li&gt;Code structure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, imagine we are building a &lt;strong&gt;food delivery application&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;At the LLD level, we might identify classes such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User
Restaurant
Food
Order
Payment
DeliveryPartner
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We then decide what each class should do and how they interact.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User → places → Order
Order → contains → Food
Order → uses → Payment
Order → assigned to → DeliveryPartner
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The goal is to create a design where each component has a &lt;strong&gt;clear responsibility&lt;/strong&gt; and the system can be easily changed later.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Should We Think About Before LLD?
&lt;/h1&gt;

&lt;p&gt;Before jumping directly into classes and code, there are a few things we should identify.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Objects / Entities
&lt;/h2&gt;

&lt;p&gt;First, identify the important entities in the problem.&lt;/p&gt;

&lt;p&gt;For a &lt;strong&gt;Parking Lot&lt;/strong&gt; system:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ParkingLot
Floor
ParkingSpot
Vehicle
Ticket
Payment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These entities will eventually become classes or components in our design.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Relationships
&lt;/h2&gt;

&lt;p&gt;Next, understand how these objects interact.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ParkingLot
   |
   └── Floors
          |
          └── ParkingSpots
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A &lt;code&gt;ParkingLot&lt;/code&gt; contains multiple &lt;code&gt;Floor&lt;/code&gt; objects, and each floor contains multiple &lt;code&gt;ParkingSpot&lt;/code&gt; objects.&lt;/p&gt;

&lt;p&gt;Understanding these relationships helps us decide whether we need &lt;strong&gt;composition, inheritance, association, or interfaces&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Data Security
&lt;/h2&gt;

&lt;p&gt;We should also think about what data needs to be protected.&lt;/p&gt;

&lt;p&gt;For example, in a banking application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User
 ├── name
 ├── accountNumber
 └── balance
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We shouldn't allow every class to directly modify &lt;code&gt;balance&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Instead, we can encapsulate it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Account&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="nf"&gt;getBalance&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;deposit&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amount&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is one of the reasons &lt;strong&gt;encapsulation&lt;/strong&gt; is important in LLD.&lt;/p&gt;




&lt;h1&gt;
  
  
  Core Goals of LLD
&lt;/h1&gt;

&lt;p&gt;There are three important qualities we should aim for.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Scalability
&lt;/h2&gt;

&lt;p&gt;Scalability means our design should be able to handle increasing requirements or usage without requiring a complete rewrite.&lt;/p&gt;

&lt;p&gt;For example, suppose our payment system initially supports:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;UPI
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Later we want:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;UPI
Credit Card
Debit Card
PayPal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A good design should allow us to add new payment methods without modifying a huge amount of existing code.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Maintainability
&lt;/h2&gt;

&lt;p&gt;Maintainability means the code should be easy to understand, debug and modify.&lt;/p&gt;

&lt;p&gt;Imagine having one class like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OrderManager
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;that handles:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Order creation
Payment
Notifications
Delivery
Database operations
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Changing one feature could break another.&lt;/p&gt;

&lt;p&gt;Instead, we can separate responsibilities:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OrderService
PaymentService
NotificationService
DeliveryService
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now each component has a clearer responsibility.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Extensibility
&lt;/h2&gt;

&lt;p&gt;Extensibility means we should be able to add new functionality with minimal changes to existing code.&lt;/p&gt;

&lt;p&gt;For example, consider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;Payment&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;pay&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;UPIPayment
CardPayment
PayPalPayment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we later introduce &lt;code&gt;CryptoPayment&lt;/code&gt;, we can create another implementation without changing the existing payment classes.&lt;/p&gt;

&lt;p&gt;This is where principles like &lt;strong&gt;SOLID&lt;/strong&gt; and design patterns become very useful.&lt;/p&gt;




&lt;h1&gt;
  
  
  LLD vs HLD
&lt;/h1&gt;

&lt;p&gt;A simple way to remember the difference is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;HLD decides what the system looks like. LLD decides how its components work internally.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  High-Level Design
&lt;/h3&gt;

&lt;p&gt;HLD deals with the overall architecture.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client
   ↓
Load Balancer
   ↓
Application Servers
   ↓
Database
   ↓
Cache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Questions include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Should we use SQL or NoSQL?&lt;/li&gt;
&lt;li&gt;How many servers do we need?&lt;/li&gt;
&lt;li&gt;Do we need caching?&lt;/li&gt;
&lt;li&gt;How do we scale the system?&lt;/li&gt;
&lt;li&gt;What technology should we use?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Low-Level Design
&lt;/h3&gt;

&lt;p&gt;LLD goes inside the application server.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OrderService
     |
     ├── Order
     ├── Payment
     ├── User
     └── Notification
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Questions include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What classes do we need?&lt;/li&gt;
&lt;li&gt;What should each class be responsible for?&lt;/li&gt;
&lt;li&gt;Which classes should interact?&lt;/li&gt;
&lt;li&gt;Should we use inheritance or composition?&lt;/li&gt;
&lt;li&gt;Which design pattern fits the problem?&lt;/li&gt;
&lt;li&gt;How can we make the code extensible?&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  A Simple Example
&lt;/h1&gt;

&lt;p&gt;Suppose we need to design a &lt;strong&gt;vehicle rental system&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;At the HLD level, we might think about:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mobile App
    ↓
Backend
    ↓
Database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At the LLD level, we think about:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Vehicle
   ↑
   ├── Car
   ├── Bike
   └── Truck

User
Rental
Payment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We then define how these objects interact and what responsibilities they have.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Takeaway
&lt;/h1&gt;

&lt;p&gt;LLD is not just about writing classes.&lt;/p&gt;

&lt;p&gt;It's about &lt;strong&gt;thinking carefully about how code should be structured before writing it&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A good LLD should aim for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clear responsibilities&lt;/li&gt;
&lt;li&gt;Low coupling&lt;/li&gt;
&lt;li&gt;High cohesion&lt;/li&gt;
&lt;li&gt;Maintainability&lt;/li&gt;
&lt;li&gt;Extensibility&lt;/li&gt;
&lt;li&gt;Reusable components&lt;/li&gt;
&lt;li&gt;Clean relationships between objects&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As I continue learning LLD, I'll be exploring &lt;strong&gt;OOP, SOLID principles, design patterns, UML diagrams, and real-world LLD problems&lt;/strong&gt; and applying these concepts through code.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Good LLD is about making the right design decisions before the code becomes difficult to change.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>architecture</category>
      <category>softwareengineering</category>
      <category>systemdesign</category>
    </item>
  </channel>
</rss>
