Why Teams Confuse HLD and LLD (and Pay the Price Later)
Most architecture reviews derail in one of two directions: either engineers spend forty minutes debating repository method signatures before agreeing whether a message queue is needed, or they draw five optimistic microservice boxes without specifying transactional boundaries, idempotency keys, or database ownership.
High-Level Design (HLD) answers structural and operational questions across network hops: what deployable units exist, how traffic enters at the edge, which datastore owns which slice of state, and how faults propagate when an external payment gateway slows down. Low-Level Design (LLD) zooms inside a single deployable boundary: which interfaces isolate domain rules from infrastructure adapters, how entities map to relational columns, and what concurrency invariants protect mutable state.
Treating HLD and LLD as two connected views of the same system—rather than competing documents—prevents both over-engineered distributed monoliths and brittle, unmaintainable service internals.
Side-by-Side Comparison: HLD vs. LLD
Before scheduling a design review, align reviewers on the altitude of the artifact. Mixing network topology with concrete DTO serialization formats obscures real trade-offs at both layers.
| Dimension | High-Level Design (HLD) | Low-Level Design (LLD) |
|---|---|---|
| Primary Scope | Macro topology: services, API gateways, queues, caches, CDNs, external SaaS | Module internals: classes, interfaces, dependency injection, state machines, ERDs |
| Core Decision Axis | Latency budgets, consistency model, fault isolation, horizontal scaling, blast radius | Cohesion, coupling, SOLID compliance, transaction scope, query plans |
| Visual Artifacts | System Context & Container diagrams, multi-region routing flows, event topologies | UML Class diagrams, Sequence flows, ERDs with PK/FK constraints & indexes |
| Review Stakeholders | Staff/Principal architects, SRE/Platform, Security, Product Engineering leads | Tech leads, domain backend/frontend engineers executing the sprint |
| Failure Signals | Shared databases across services, synchronous fan-out chains, missing DLQs | God services, circular package imports, leaky ORM entities in API contracts |
Review HLD whenever a change alters network boundaries, failure modes, or datastore ownership. Review LLD whenever a change introduces new core abstractions, multi-table invariants, or public module APIs.
Walkthrough: E-Commerce Order & Payment Architecture
Consider designing an e-commerce checkout workflow supporting bursty flash-sale traffic, inventory reservation, and external payment settlement. At the HLD layer, placing everything inside a synchronous REST cascade from Checkout API -> Inventory -> Payments -> Notification creates unacceptable tail latency and cascading failures when the email provider or PSP throttles.
A resilient HLD splits responsibilities cleanly: an API Gateway terminates TLS and enforces per-user rate limits before routing to an Order Service backed by its own PostgreSQL database. Inventory stock checks run against an atomic reservation table (or Redis Lua semaphore for flash drops), while Order Service writes an OrderCreated event into an Outbox table processed asynchronously onto Kafka for Email, Analytics, and Fraud workers.
Now zoom into the LLD of the Order Service itself. Without clean module boundaries, engineers frequently inject concrete database contexts and third-party payment SDKs directly into HTTP controllers. An LLD pass introduces clear application ports (`IPaymentGateway`, `IInventoryLock`, `IOrderRepository`), keeping `IdempotentOrderService` pure and unit-testable without live network sockets.
@startuml
interface IPaymentGateway {
+authorize(orderId: UUID, amountMinor: long, idempotencyKey: string): AuthResult
+capture(providerTxId: string): CaptureResult
}
interface IOrderRepository {
+saveWithOutbox(order: Order, event: OutboxEvent): void
+findByIdempotencyKey(key: string): Order?
}
class OrderController {
-orderService: PlaceOrderUseCase
+placeOrder(req: PlaceOrderRequest): ResponseEntity<OrderDto>
}
class PlaceOrderService {
-repo: IOrderRepository
-paymentGateway: IPaymentGateway
+execute(cmd: PlaceOrderCommand): OrderReceipt
}
class PaymentGatewayAdapter implements IPaymentGateway
class PostgresOrderRepository implements IOrderRepository
OrderController --> PlaceOrderService
PlaceOrderService --> IOrderRepository
PlaceOrderService --> IPaymentGateway
@endumlFour Anti-Patterns That Ruin HLD and LLD Artifacts
Even experienced teams slip into recurring mistakes that make design reviews theatrical rather than predictive:
- The Distributed Monolith HLD: Drawing six microservice boxes that all read and write to the same PostgreSQL tables. If schemas are coupled, deployables cannot evolve independently.
- Box-and-Line Handwaving: Connecting boxes with unlabeled arrows like 'calls' without specifying sync HTTP vs. async queue, timeout budgets, or retry idempotency.
- Anemic LLD Mirrors: Copying every getter/setter DTO onto a UML canvas so the diagram becomes unreadable noise instead of highlighting interfaces, ownership, and invariants.
- Unconnected Database Modeling: Deferring foreign keys, unique constraints, and hot-path indexes until after the API is already written—forcing painful migrations before launch.
A Repeatable Design Workflow: HLD -> LLD -> Schema -> Code
High-leverage engineering teams keep architecture reviews fast by time-boxing artifacts into a predictable sequence:
First, capture the HLD topology (inputs, edge auth, core services, async boundaries, stores, and failure fallbacks) and run a quick Single-Point-of-Failure audit. Second, sketch the core LLD interfaces and sequence invariants for any complex business flow so engineers agree on domain ownership. Third, materialize critical relational constraints (`UNIQUE`, `FOREIGN KEY`, composite indexes) in a visual ERD and verify SQL DDL cleanly before generating boilerplate code.
Never let design docs become write-only wikis. Export LLD diagrams directly into versioned Mermaid/PlantUML alongside Markdown Technical Design Docs in the repository, and re-scan the repository after implementation to verify actual edges match your blueprint.
Turn architecture guides into living diagrams
Start free with 5 boards and 20 AI credits/month—spanning interactive HLD Canvas, LLD UML modeling, Database Schema Studio, and Repository Architecture mapping.