Serializing data almost always turns out to be a bad idea, because in doing so you cripple dbms. All human years that have entered into the creation of effective dbms will be wasted on a serialized bucket of bits.
If you have application logic associated with each parameter, I think you should implement it as:
1 column per setting in the settings table. This makes it easy to use the capabilities of your dbms, check constraints, referential integrity, the correct data type for your values, a lot of information for the optimizer. The disadvantage is that the size of the string is increasing.
or
1 table per setting (or a group of related settings). This has all the advantages of the above, but trades in series to reduce performance when you need to get most or all of the settings at once. If the parameters are optional, this alternative will be significantly less if the actual data is sparse.
In addition, a lot of columns are often a "smell", which suggests that you didn’t normalize your data correctly, but that doesn’t have to be that way. Only you know your details.
Ronnis
source share