Best table design for application configuration or application option settings?

后端 未结 12 2564
说谎
说谎 2020-12-25 10:01

I need to store a series of configuration values in a database. A couple ways I thought of to store them are: a table with 2 colums(name,value) and a row for each pair, or

12条回答
  •  误落风尘
    2020-12-25 10:37

    I think the 2-column (name, value) design is much better. As you said, if you need to add a new property, all you need to do is to "insert" a new row. While in the other design (single-row), you'll need to change the table schema to add a column for the new property.

    This, however, depends on whether your list of properties are going to change in the future.

提交回复
热议问题