I have following abstracted model in my application.
Entity "Product"
Id | Name | Attribute 1 | Attribute 2 | ... | Attribute N = 50
Attributes are fixed by a business model and can only have specific, predefined characteristics, i.e.:
Attribute 1
1 | Blue
2 | Red
3 | Yellow
Attribute 2
1 | S
2 | M
3 | L
Referencing these attributes by a one-to-many or many-to-many would make sense, if I would only have a hand full of so defined attributes... However, we have a lot of these attributes, lets say N=50 predefined, specific attributes.
That would mean a query must perform N=50 joins to receive the entire product from database. That does not seem like a well-performing, well-scaling approach, especially when increasing the amount of products (several tens of thousands).
In a NoSQL database like MongoDB I would design it probably like as including the references directly in the same document:
{
"Id":"1"
"name":"somename"
"attributes": {
"attribute1":{"1":"red"}
"attribute2":{"1":"S"}
...
"attribute50":{"1":"something"}
}
}
But for SQL and RDBMS im kind of stuck or can't find a proper solution.