Gimmly
Gimmly

Reputation: 463

is this design valid for a database?

I'm developing an online shop web application with ASP.NET MVC and EF. One of the requirements is that each product should be categorized, each category can have subcategories. But the problem is that each category can have multiple properties that are unknown. All these properties are of the string type.

This is how i designed the DB:

My concern is that the attributes table will grow very fast. And i'm thinking i might run out of space for the attributes. Is that possible? Is this a feasable design for this environment?

Upvotes: 0

Views: 46

Answers (1)

Jan Nielsen
Jan Nielsen

Reputation: 11799

Yes; it's valid design. Whether your design scales to your needs is another question. Ask yourself:

  • how many rows will my products table have in 1, 2, and 4 years?
  • how many rows will my category table have in 1, 2, and 4 years?
  • how many rows will my attributes table have in 1, 2, and 4 years?

If you see your attributes table growing uncontrollably over time with respect to your products and categories then you likely have a scaling problem. On the other hand, if after a short while your products table stabilizes then you likely don't have a problem.

Pro tip: solve the problem when it becomes a problem (i.e., listen to the product manager and then add realism... ;-).

Upvotes: 1

Related Questions