Is It Reasonable to Simplify Product Variant Design Using Notes Instead of Complex Relations?

I'm building an application where product variants are intended to be handled as physical products already prepared and listed manually. Instead of using a conventional approach with complex relations between Product, Option, OptionValue, and SKUValue tables, I'm trying to simplify the design.

💡 ERD Design:

+--------------+        +-----------------+
|   Product    |        |  ProductVariant  |
+--------------+        +-----------------+
| id (PK)      |<------>| id (PK)          |
| name         |        | product_id (FK)  |
| owner_id (FK)|        | note             | 
| created_at   |        | stock            |
| updated_at   |        | price            |
+--------------+        +-----------------+

In the ProductVariant table, the note field is a simple text field where users can manually enter descriptions like "Size: XL, Color: Red".

🔍 Django Models Based on This Design:

from django.db import models
from django.contrib.auth import get_user_model

User = get_user_model()

class Product(models.Model):
    name = models.CharField(max_length=255)
    owner = models.ForeignKey(User, on_delete=models.CASCADE, related_name='products')
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)

    def __str__(self):
        return self.name


class ProductVariant(models.Model):
    product = models.ForeignKey(Product, on_delete=models.CASCADE, related_name='variants')
    note = models.TextField()  # Example: "Size: XL, Color: Red"
    stock = models.PositiveIntegerField()
    price = models.DecimalField(max_digits=10, decimal_places=2)

    def __str__(self):
        return f"{self.product.name} - {self.note}"

🎯 Why I'm Doing This:

  1. The application is designed to handle product variants that are often predefined and don't change dynamically.
  2. Users will manually input variant descriptions based on the actual physical products they have.
  3. The goal is to avoid overengineering by eliminating unnecessary tables and relationships.

🤔 What I'm Concerned About:

  • I know that most applications use well-structured relational models for managing product variants.
  • However, implementing such complex structures seems overkill for my use case, and I'm worried it might create unnecessary complications.
  • I'm concerned this simplified approach could be considered "bad design" even if it suits my use case better.

❓ Question:

Is this simplified design using manual notes for product variants acceptable in scenarios where variants are predefined and manually recorded? What are the potential pitfalls I should be aware of when using this design compared to a more "standard" relational model?

Вернуться на верх