Bird
Raised Fist0
HLDsystem_design~7 mins

Product catalog design in HLD - System Design Guide

Choose your learning style9 modes available
Problem Statement
When an e-commerce platform grows, storing all product information in a single database table or service causes slow searches, poor user experience, and difficulty in managing diverse product types. Without a scalable design, adding new product categories or attributes becomes error-prone and costly.
Solution
The product catalog design organizes product data into modular components with flexible schemas, enabling efficient search and easy extension. It separates core product information from category-specific attributes and uses indexing and caching to speed up queries. This design supports multiple product types and scales horizontally as the catalog grows.
Architecture
Product Core
(ID, Name,
Category Data
Search & Index Layer
API Layer
API Layer

This diagram shows the separation of product core data, category-specific data, and flexible attribute storage, all feeding into a search and indexing layer that supports efficient queries through an API.

Trade-offs
✓ Pros
Supports diverse product types with flexible attribute storage.
Improves search performance by indexing core and attribute data separately.
Eases addition of new categories without schema changes to core tables.
Enables horizontal scaling by separating concerns.
✗ Cons
Increased complexity in data modeling and query logic.
Requires careful synchronization between core and attribute data.
Potentially higher latency for complex queries joining multiple tables.
Use when the product catalog has multiple categories with different attributes and the system expects high read traffic with frequent searches and filters.
Avoid if the catalog is small (under a few thousand products) with uniform attributes, where a simple flat schema suffices.
Real World Examples
Amazon
Amazon uses a flexible product catalog design to handle millions of products across thousands of categories, each with unique attributes, enabling fast search and filtering.
Shopify
Shopify supports diverse merchant catalogs by separating core product data from customizable attributes, allowing merchants to define their own product fields.
eBay
eBay manages a large, dynamic catalog with category-specific attributes and uses indexing layers to provide quick search and filtering for buyers.
Alternatives
Monolithic Flat Schema
Stores all product attributes in a single table with many nullable columns.
Use when: Choose when the product catalog is small and attributes are mostly uniform across products.
Document Store Catalog
Uses a NoSQL document database to store each product as a flexible JSON document.
Use when: Choose when product attributes vary widely and schema flexibility is paramount, with less complex relational queries.
Graph-based Catalog
Represents products and attributes as nodes and edges in a graph database.
Use when: Choose when relationships between products, categories, and attributes are complex and require traversal queries.
Summary
Product catalog design separates core product data from flexible category-specific attributes to handle diverse products efficiently.
It uses indexing and modular schemas to enable fast search and easy extension as the catalog grows.
This design balances flexibility and performance, suitable for large-scale e-commerce platforms with varied product types.