Managing product variants is essential for e-commerce platforms, especially in multi-vendor setups where diverse products, attributes, and variants can quickly become complex. In this post, we’ll explore a structured approach to organizing and storing product variants in a way that’s scalable and easy to manage.
Step 1: Create an Attributes Table
The first step is to create a central Attributes table to hold general attributes that apply to products across the platform. Attributes like size, color, and material give customers flexibility and allow you to customize each product.
Attributes Table Example:
| Attribute ID |
Attribute Name |
| 1 |
Size |
| 2 |
Color |
| 3 |
Material |
Each row here represents an attribute category, which can later be linked to individual products as needed.
Attributes Values Table
Once you’ve set up the Attributes table, it’s time to add an Attributes Values table. This table stores specific values for each attribute. For instance, if "Color" is an attribute, then "Red," "Blue," and "Green" would be values under that attribute. By structuring it this way, we keep things organized and flexible.
Attributes Values Table Example:
| Attribute Value ID |
Attribute ID |
Name |
Value |
| 1 |
2 |
Red |
#00ff00 |
| 2 |
2 |
Blue |
#00ff33 |
| 3 |
1 |
M |
|
| 4 |
1 |
L |
|
| 5 |
3 |
Cotton |
|
| 6 |
3 |
Wool |
|
This setup allows each product to have multiple possible values for each attribute, and it keeps data centralized and easy to manage.
Step 2: Create the Product Table
With the attributes structured, the next step is to set up the Product table, where each row represents a unique product in the catalog. This table holds general product information, like the name, description, and base price, which will be consistent across all variants.
Product Table Example:

The Product table is intentionally broad, allowing it to represent various types of products.
Step 3: Build the Product Variant Table
Now for the core piece of the puzzle: the Product Variant table. Each row here represents a unique variant of a product, combining specific attribute values like color, size, or material. This setup enables detailed management and storage of each product variant.
Product Variant Table Example:
| Variant ID |
Product ID |
SKU |
Variant |
Quantiy |
Price |
| 1 |
1 |
sku258 |
Red-Wool |
10 |
$10.00 |
| 2 |
1 |
sku912 |
Blue-M |
25 |
$11.00 |
| 3 |
2 |
sku211 |
Denim-Red-S |
52 |
$42.00 |
The Product Variant table links each variant back to the Product table, making it easy to retrieve all variants of a given product and keeping things manageable even with a large product catalog.