Skip to content
Tutorials Center
My learning

Topics

Lesson 4 of 40 ยท Catalog and Products

Product Catalogs and Data Modeling

Design a product catalog that scales: products and SKUs, attributes, categories versus collections, brands, translations, bundles and digital goods.

The catalog is the foundation of a shop. Everything else (search, pricing, cart, SEO, inventory) reads from it. A catalog that is modeled well lets merchants add ten thousand products without developer help. A catalog that is modeled badly means every new product type needs a new database column and a code change.

This lesson covers the building blocks: products and SKUs, attributes, categories and collections, brands, translations, special product types such as bundles, and the difference between physical and digital goods. Variants and Options then goes deeper on the "one product, many versions" problem. If you need the vocabulary first, see The Core Domain Model.

Products and SKUs

A product is what the customer reads about: title, description, images, brand. A SKU (stock keeping unit) identifies one sellable, stockable item, and in most platforms each SKU lives on a variant. A simple product, such as a single ceramic mug, has exactly one variant. A t-shirt has many.

A good SKU is:

  • Unique across the whole catalog, forever. Never reuse the SKU of a discontinued item.
  • Stable. It is printed on warehouse labels, supplier documents and invoices.
  • Readable if possible, such as MUG-CER-BLU, but never required to encode meaning. Do not parse business logic out of a SKU.
  • Distinct from barcodes. A GTIN, EAN or UPC barcode is a global product identifier that you store as another field. Your SKU is internal.

Also store the data that other systems need and that is hard to add later: weight and dimensions (shipping), a tax class (tax), a country of origin and customs code (international orders), and the barcode (marketplaces and feeds).

Attributes: fixed columns, flexible fields

Products differ. A laptop has screen size and RAM; a shirt has fabric and fit. There are three common ways to store these facts, each with trade-offs.

  1. Wide table. One column per attribute. Fast and simple for a small, fixed set, but a new attribute means a migration, and most columns are empty for most products.
  2. Entity-attribute-value (EAV). Rows of (product_id, attribute, value). Infinitely flexible, but queries become awkward and slow, and values have no types.
  3. JSON column. A document of attributes next to the product. Flexible and compact, and modern databases can index into it, but you must validate the structure yourself.

Many shops combine them: real columns for universal fields (title, price, weight), and a typed attribute system for the rest. The key idea in the better designs is the product type (also called attribute set or template). A "Laptop" type says which attributes exist, their data types, which are required, and which are filterable on the category page.

JS Product types validate attributes

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Validation like this keeps the catalog clean. Without it, one merchant types "16 GB", another "16gb" and a third "16", and the filter sidebar becomes useless.

Categories and collections

Both group products, but they answer different questions.

  • A category is a place in a tree: Electronics, Computers, Laptops. Each product usually belongs to one primary category (and perhaps more for cross-listing). Categories drive navigation, breadcrumbs and URLs, so they change slowly and carefully.
  • A collection is a flexible, often temporary grouping: "Summer sale", "Gifts under 50", "New this week". Collections can be hand-picked or automatic, defined by rules such as "tag equals gift and price is below 50".
flowchart TB
    R["Electronics"] --> C["Computers"]
    C --> L["Laptops"]
    C --> D["Desktops"]
    L --- P1(["Laptop A"])
    L --- P2(["Laptop B"])
    S["Collection:<br/>Back to school"] -.-> P1
    S -.-> P3(["Backpack"])

Categories form a tree used for navigation. A collection cuts across the tree.

A common mistake is to use categories for marketing groupings. Then the navigation tree fills with "Black Friday 2025" and URLs break every season. Keep the tree for structure and use collections for campaigns.

Tip: Store the category as a parent ID per node (or a path such as electronics/computers/laptops). Fetching "all products in Computers, including subcategories" is then a tree walk, so decide early how you will query descendants.

Brands, tags and other classifications

  • A brand (or manufacturer) is its own entity, not a free-text field. It has a name, a logo, a page and a slug, and it is a natural filter. Free text produces "Acme", "ACME" and "Acme Inc.".
  • Tags are lightweight labels used for rules and search. Cheap to add, but without governance they become noise.
  • Vendor/supplier is who you buy from; it may differ from the brand and is rarely shown to customers.

Translations and localization

If the shop serves several languages, split product data into two groups:

  • Language-independent: SKU, weight, barcode, images, base price.
  • Translatable: title, description, slug, meta title, option names.

Store translations in a separate table keyed by (product_id, locale), with a fallback to the default language when a translation is missing. Remember that URL slugs are translated too, and that the same product needs one canonical URL per language. Currency and number formats are a separate concern, covered in Currencies and Localization.

Product types: simple, bundles, kits and digital goods

Not every product behaves like a box on a shelf.

  • Simple product. One SKU, one price, one stock number.
  • Configurable product. A product with variants (size, colour).
  • Bundle. A fixed set of products sold together, such as a camera, lens and bag, usually at a discounted price. Decide whether stock comes from the components or from the bundle itself.
  • Kit or assembly. The customer buys one item, but the warehouse picks several parts. Stock availability is the minimum across the components, divided by the quantity each needs.
  • Digital product. A download, a licence key or an online course. There is nothing to ship, no weight, usually unlimited stock, but you need delivery of access, protection against sharing, and different tax rules in many regions.
  • Service or subscription. Recurring or time-based, billed on a schedule.

The product type decides which fields matter. Shipping settings are irrelevant to a download; licence delivery is irrelevant to a mug.

JS Bundle availability from component stock

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The limiting component decides how many kits you can sell. The stock lessons return to this when they discuss reservations.

Keep the catalog clean

Catalog quality is operational work as much as design.

  • Give every field an owner and a validation rule.
  • Prefer enumerated values (a list of allowed colours) over free text.
  • Import products through a repeatable process (CSV or API) that reports row-level errors.
  • Use stable slugs, and redirect old URLs when a slug changes.
  • Mark products as draft, active or archived instead of deleting them, because old orders still point at them.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the main benefit of a product type (attribute set) such as Laptop?

    A product type says which attributes a product has, their types and whether they are required, which keeps data consistent and filters usable.
  2. 2. Which grouping is best for a temporary 'Back to school' campaign?

    Collections are flexible and temporary. Categories form the stable navigation tree and should not carry seasonal marketing groups.
  3. 3. A kit needs 1 camera, 1 lens and 2 straps. Stock is 4 cameras, 9 lenses and 6 straps. How many kits can be sold?

    Straps allow floor(6 / 2) = 3 kits, cameras 4 and lenses 9. The smallest value, 3, is the limit.
  4. 4. Why should a discontinued product usually be archived instead of deleted?

    Historical records need the product to exist. Archiving hides it from the storefront without breaking old data.

Summary

  • A product is what customers read about; a SKU identifies one stockable, sellable variant and must stay unique and stable.
  • Use product types to define and validate attributes instead of free-form fields.
  • Categories form a navigation tree; collections are flexible groupings for campaigns and rules.
  • Model brands as entities, split translatable from language-independent data, and keep translated slugs.
  • Bundles, kits and digital goods need different handling of stock, shipping and delivery.
  • Archive rather than delete, and import catalog data through validated, repeatable processes.

Next: Variants and Options, where one product becomes many sellable versions.