Config files vs database tables

喜欢而已 提交于 2019-12-04 03:06:08

It all depends on the scale of the operation you're managing.

If the number of locations is large and/or changes are frequent, use a database.

Otherwise, use configuration files.

If access to a centralized database is too slow or unacceptably a point of failure, but the scale is still large, use an automated system like Puppet.

Most companies with a need to share configuration parameters between servers/applications end up creating their own configuration mechanisms and storing them in a home-rolled relational database. I would argue that the scale doesn't even matter. Having to log into multiple servers in order to check a configuration on the file system is a nightmare. However, even when managing configuration in a central database, you still have to make sure that the configuration is easy to access. I've seen this type of configuration used at 3 different companies, and the only place that it was used in a truly successful manner, was where the application exposed a simple user interface allowing system administrators to tweak the settings. If it's only accessible by using a SQL client, you'll find that configurations will easily get "lost" or worse, duplicated.

The above poster mentioned Puppet, which I've never used, but it looks VERY interesting. However it doesn't look like it supports Windows yet [1]: http://www.puppetlabs.com/puppet/requirements/

If the config properties can be updated at runtime, centralizing the properties in the DB will make life easier.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!