How do you structure config data in a database?

后端 未结 18 1287
后悔当初
后悔当初 2021-01-31 04:37

What is people\'s prefered method of storing application configuration data in a database. From having done this in the past myself, I\'ve utilised two ways of doing it.

18条回答
  •  逝去的感伤
    2021-01-31 05:18

    Option 1 is good for an easily expandable, central storage location. In addition to some of the great column suggestions by folks like RB, Hugo, and elliott, you might also consider:

    Include a Global/User setting flag with a user field or even a user/machine field (for machine-specific UI type settings).

    Those can, of course, be stored in a local file, but since you are using the database anyway, that makes these available for aliasing a user when debugging - which can be important if the bug is setting related. It also allows an admin to manage setings when necessary.

提交回复
热议问题