Link to home
Start Free TrialLog in
Avatar of ulf-jzl
ulf-jzlFlag for Sweden

asked on

Database design decision, Name/Value

Hi guys!

I really need some help and your skills with a design decision regarding a specific part of a database.
The database mostly consists of tables that follow the normalization rules (3NF). But there is also a part of the database where this would be hard to do, this because the parameters that needs to be saved changes a lot (new parameters and/or different parameters), and this occurs several times a year, depending on the products. To migrate the database so often to handle all these changes will be painful.

The parameters are settings from products. So, a “decision” was made to go with a Name/Value setup for these specific parameters. Both values and names are 99% strings when retrieving them from the product.  They are also “dynamically” read, so there is no code to target a specific parameter, you loop through all parameters that exists, why? Because this module was designed to be flexible, so it could be added to any type of product, and also so no updates where needed if any new parameters where added to a product, or changed. But still, not sure the design is the correct one.

What I need help with is to look over the decision of this design and see if this is the best way to go forward with, depending the current situation, or If we should do something else.

Example:
Value could be anything from, “10”, “xxxxxOn”, “xxxxxxOff”, “true”, “0, “1” and so on, basically anything, that is why a string (NVARCHAR) is used.

The name of the parameters can also be very odd, not normal column names (not in my opinion anyway) so naming columns after the parameter names will probably look very strange.

Product 1
Parameter       Name:             Value:
      “Parameter1”            “Value1”
      “Parameter2”            “Value2”
      “Parameter3”            “Value3”
      …..
Product 2
Parameter       Name:             Value:
      “Parameter1”            “Value1”
      “Parameter4”            “Value4”
      “Parameter5”            “Value5”
      ……
Product 3
Parameter       Name:             Value:
      “Parameter1”            “Value1”
      “Parameter4”            “Value4”
      “Parameter6”            “Value6”
      ….

User generated image
ASKER CERTIFIED SOLUTION
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ulf-jzl

ASKER

Ok, thank you. In that case we will proceed with current solution.