Bird
Raised Fist0
HLDsystem_design~15 mins

Product catalog design in HLD - Deep Dive

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Overview - Product catalog design
What is it?
A product catalog design is a way to organize and store information about products in a system. It includes details like product names, descriptions, prices, categories, and images. This design helps users find and understand products easily. It is used in online stores, marketplaces, and inventory systems.
Why it matters
Without a well-designed product catalog, users would struggle to find products or get accurate information. This would lead to poor shopping experiences and lost sales. A good catalog design ensures products are easy to search, compare, and manage, which improves customer satisfaction and business efficiency.
Where it fits
Before learning product catalog design, you should understand basic database concepts and system design principles. After mastering it, you can explore related topics like search optimization, recommendation systems, and scalable e-commerce architectures.
Mental Model
Core Idea
A product catalog design organizes product information in a clear, searchable, and scalable way to help users find and manage products efficiently.
Think of it like...
Think of a product catalog like a well-organized library where books (products) are sorted by genre, author, and title, making it easy to find exactly what you want.
┌─────────────────────────────┐
│        Product Catalog       │
├─────────────┬───────────────┤
│ Product ID  │ Unique ID     │
│ Name        │ Product name  │
│ Description │ Details       │
│ Price       │ Cost          │
│ Category    │ Grouping      │
│ Images      │ Visuals       │
│ Attributes  │ Size, color   │
└─────────────┴───────────────┘
Build-Up - 6 Steps
1
FoundationUnderstanding product data basics
🤔
Concept: Learn what basic product information is needed to describe a product.
Products have simple details like name, description, and price. These are the minimum to show a product to a user. For example, a T-shirt needs a name, a short description, and a price to be listed.
Result
You can identify the core fields every product must have to be useful in a catalog.
Knowing the essential product fields helps you build a catalog that covers the minimum user needs without overload.
2
FoundationOrganizing products by categories
🤔
Concept: Introduce grouping products into categories to improve browsing and searching.
Products are grouped into categories like 'Clothing', 'Electronics', or 'Books'. Categories help users narrow down choices. Categories can be nested, like 'Clothing > Men > Shirts'.
Result
You understand how to structure products so users can browse logically.
Categorization reduces user effort by guiding them through a smaller, relevant set of products.
3
IntermediateAdding product attributes and variants
🤔Before reading on: do you think all products have the same attributes or do they vary? Commit to your answer.
Concept: Learn how to handle product-specific details like size, color, or model variations.
Products often have attributes that differ by type. For example, a shoe has size and color, while a laptop has RAM and storage options. Variants are different versions of the same product, like a red or blue T-shirt in sizes S, M, L.
Result
You can design flexible catalogs that handle diverse product details and variants.
Understanding attributes and variants allows catalogs to represent real-world product diversity accurately.
4
IntermediateDesigning for search and filtering
🤔Before reading on: do you think search works best by scanning all product text or by using structured data? Commit to your answer.
Concept: Explore how to enable users to find products quickly using search and filters.
Search uses product names, descriptions, and attributes to find matches. Filters let users narrow results by category, price range, or attributes like color. Efficient search requires indexing and structured data storage.
Result
You can create catalogs that support fast, relevant product discovery.
Designing for search and filtering improves user experience and reduces frustration in large catalogs.
5
AdvancedScaling catalog for large inventories
🤔Before reading on: do you think a single database can handle millions of products efficiently? Commit to your answer.
Concept: Learn techniques to keep catalogs fast and reliable as product numbers grow.
Large catalogs use database sharding, caching, and content delivery networks (CDNs) to handle scale. Data is often denormalized for faster reads. Systems must handle updates without downtime.
Result
You understand how to build catalogs that perform well under heavy load.
Knowing scaling techniques prevents slow searches and downtime in real-world large product catalogs.
6
ExpertHandling complex product relationships
🤔Before reading on: do you think products can be related beyond categories and variants? Commit to your answer.
Concept: Explore advanced relationships like bundles, accessories, and cross-sells.
Products can be linked as bundles (multiple products sold together), accessories (items that complement others), or replacements. Managing these relationships requires additional data structures and logic.
Result
You can design catalogs that support rich product connections to boost sales and user experience.
Understanding complex relationships enables catalogs to drive marketing strategies and personalized recommendations.
Under the Hood
A product catalog stores product data in databases, often relational or NoSQL. It uses indexes to speed up search and filtering. Variants and attributes are stored in flexible schemas or separate tables. Caching layers reduce database load. APIs serve product data to users or other systems.
Why designed this way?
Catalogs evolved to handle growing product diversity and user expectations for fast search. Early simple lists became complex systems to support filtering, variants, and scale. Tradeoffs balance data normalization for consistency and denormalization for speed.
┌───────────────┐      ┌───────────────┐      ┌───────────────┐
│ Product Table │─────▶│ Attribute Tbl │─────▶│ Variant Table │
└───────────────┘      └───────────────┘      └───────────────┘
       │                      │                      │
       ▼                      ▼                      ▼
┌───────────────┐      ┌───────────────┐      ┌───────────────┐
│ Category Tbl  │      │ Search Index  │      │ Cache Layer   │
└───────────────┘      └───────────────┘      └───────────────┘
Myth Busters - 4 Common Misconceptions
Quick: Do you think storing all product data in one big table is best for performance? Commit yes or no.
Common Belief:Putting all product details in one big table is simpler and faster.
Tap to reveal reality
Reality:Storing all data in one table leads to slow queries and hard updates as the catalog grows.
Why it matters:Ignoring normalization and modular design causes slow search and difficult maintenance in large catalogs.
Quick: Do you think product variants should be separate products? Commit yes or no.
Common Belief:Each variant like color or size should be a separate product entry.
Tap to reveal reality
Reality:Variants are better managed as linked versions of one product to avoid duplication and confusion.
Why it matters:Treating variants as separate products causes clutter and poor user experience in browsing and inventory.
Quick: Do you think search can rely only on product names? Commit yes or no.
Common Belief:Searching product names alone is enough for users to find what they want.
Tap to reveal reality
Reality:Users need search over descriptions, attributes, and filters for relevant results.
Why it matters:Limited search scope frustrates users and reduces sales opportunities.
Quick: Do you think caching product data is unnecessary complexity? Commit yes or no.
Common Belief:Caching adds complexity and is not needed for product catalogs.
Tap to reveal reality
Reality:Caching is essential for fast response times and reducing database load in large systems.
Why it matters:Skipping caching leads to slow page loads and poor user experience under heavy traffic.
Expert Zone
1
Handling attribute inheritance where variants share some but not all attributes with the main product.
2
Balancing normalization and denormalization to optimize between data consistency and query speed.
3
Designing APIs that allow flexible querying without exposing internal database complexity.
When NOT to use
For very small catalogs with few products, a simple flat file or spreadsheet may suffice instead of a complex catalog system. For highly dynamic or personalized catalogs, consider specialized search engines or recommendation systems instead.
Production Patterns
Real-world catalogs use microservices to separate product management from search services. They employ event-driven updates to keep caches fresh and use CDN for image delivery. Many use schema-less databases for flexible attributes.
Connections
Database normalization
Builds-on
Understanding normalization helps design product tables that avoid data duplication and maintain consistency.
Search engine indexing
Same pattern
Product catalogs use search indexing techniques similar to search engines to enable fast and relevant product discovery.
Library classification systems
Analogy in organization
Knowing how libraries organize books by categories and attributes helps understand product catalog grouping and filtering.
Common Pitfalls
#1Mixing product variants as separate products causing duplication.
Wrong approach:ProductID: 101, Name: T-shirt Red, Size: M ProductID: 102, Name: T-shirt Blue, Size: M
Correct approach:ProductID: 100, Name: T-shirt Variants: [{Color: Red, Size: M}, {Color: Blue, Size: M}]
Root cause:Misunderstanding that variants are attributes of one product, not separate products.
#2Storing all product attributes in one fixed schema causing inflexibility.
Wrong approach:Table with columns: Name, Price, Color, Size, RAM, Storage, BatteryLife
Correct approach:Separate attribute table with key-value pairs linked to products for flexible attributes.
Root cause:Assuming all products share the same attributes leads to rigid and bloated schemas.
#3Not using caching leading to slow response times under load.
Wrong approach:Every product page request queries the database directly without cache.
Correct approach:Use caching layer like Redis to store frequently accessed product data.
Root cause:Underestimating traffic and database load causes performance bottlenecks.
Key Takeaways
A product catalog organizes product information to make it easy for users to find and understand products.
Categorizing products and managing variants are key to handling diverse product lines effectively.
Designing for search and filtering greatly improves user experience in large catalogs.
Scaling catalogs requires careful database design, caching, and indexing strategies.
Advanced catalogs manage complex product relationships to support marketing and sales goals.

Practice

(1/5)
1.

What is the primary purpose of a product catalog in an e-commerce system?

easy
A. To organize products into categories for easy browsing
B. To process payments securely
C. To manage user login sessions
D. To handle shipping and delivery logistics

Solution

  1. Step 1: Understand the role of a product catalog

    A product catalog groups products logically so users can browse easily.
  2. Step 2: Differentiate from other system components

    Payment, user sessions, and shipping are separate concerns from product organization.
  3. Final Answer:

    To organize products into categories for easy browsing -> Option A
  4. Quick Check:

    Product catalog = Organize products [OK]
Hint: Catalog = product organization, not payments or shipping [OK]
Common Mistakes:
  • Confusing catalog with payment processing
  • Mixing catalog with user authentication
  • Thinking catalog manages shipping
2.

Which data structure is most suitable to represent categories and subcategories in a product catalog?

A. Array
B. Linked List
C. Tree
D. Hash Map

easy
A. Array
B. Linked List
C. Hash Map
D. Tree

Solution

  1. Step 1: Analyze category relationships

    Categories have parent-child relationships, forming a hierarchy.
  2. Step 2: Choose data structure for hierarchy

    A tree structure naturally represents hierarchical data with branches and leaves.
  3. Final Answer:

    Tree -> Option D
  4. Quick Check:

    Hierarchy = Tree [OK]
Hint: Hierarchies = Trees, not flat lists or arrays [OK]
Common Mistakes:
  • Using arrays which are flat and unordered
  • Choosing linked lists which are linear
  • Hash maps don't represent hierarchy well
3.

Consider a product catalog system that uses an inverted index for search. What is the main benefit of using an inverted index?

medium
A. It manages user reviews and ratings
B. It stores product images efficiently
C. It speeds up product search by mapping keywords to product IDs
D. It handles payment transactions securely

Solution

  1. Step 1: Understand inverted index purpose

    An inverted index maps keywords to the list of documents or products containing them.
  2. Step 2: Apply to product search

    This mapping allows fast lookup of products matching search terms, improving speed.
  3. Final Answer:

    It speeds up product search by mapping keywords to product IDs -> Option C
  4. Quick Check:

    Inverted index = fast keyword search [OK]
Hint: Inverted index = keyword to product map for fast search [OK]
Common Mistakes:
  • Thinking it stores images
  • Confusing with user review storage
  • Mixing with payment processing
4.

A product catalog system caches product details but users report seeing outdated information. What is the likely cause?

medium
A. Cache invalidation is not handled properly after product updates
B. The database schema is incorrect
C. User authentication is failing
D. The product images are missing

Solution

  1. Step 1: Identify caching issue

    Outdated info usually means cache still holds old data after updates.
  2. Step 2: Understand cache invalidation

    Proper cache invalidation removes or refreshes cached data when products change.
  3. Final Answer:

    Cache invalidation is not handled properly after product updates -> Option A
  4. Quick Check:

    Outdated cache = invalidation problem [OK]
Hint: Outdated data? Check cache invalidation first [OK]
Common Mistakes:
  • Blaming database schema without evidence
  • Confusing with authentication issues
  • Assuming missing images cause outdated text
5.

You are designing a product catalog for a global e-commerce platform with millions of products and frequent updates. Which design choice best supports scalability and fast search?

A. Use a distributed NoSQL database with indexing and cache layers
B. Store all products in a single relational database without caching
C. Use flat files to store product data and search sequentially
D. Keep product data only in application memory without persistence

hard
A. Store all products in a single relational database without caching
B. Use a distributed NoSQL database with indexing and cache layers
C. Use flat files to store product data and search sequentially
D. Keep product data only in application memory without persistence

Solution

  1. Step 1: Consider scalability needs

    Millions of products and frequent updates require a scalable, distributed system.
  2. Step 2: Evaluate design options

    A distributed NoSQL database supports horizontal scaling; indexing enables fast search; caching improves response time.
  3. Step 3: Reject unsuitable options

    Single DB limits scale; flat files are slow; in-memory only risks data loss.
  4. Final Answer:

    Use a distributed NoSQL database with indexing and cache layers -> Option B
  5. Quick Check:

    Scalable + fast search = distributed NoSQL + index + cache [OK]
Hint: Scale needs distributed DB + index + cache, not flat files [OK]
Common Mistakes:
  • Choosing single DB without caching for large scale
  • Using flat files causing slow search
  • Relying on memory only risking data loss