Web.Config vs Database Settings table

When you have a system of several applications, web services and Windows services, what is the best option?

Option 1) Put all the settings in the database table and cache it somewhere, you may need to use a web service to share the cache object between applications. Then you can view some of these settings in the grid for custom manipulations.

Option 2) Put all the settings in a common configuration file and let web.config or app.config of each application point to this file, I'm sure there is a way to place these settings in the grid, but you will probably lose the ability to "show settings based on roles. "

thank

+5
source share
3 answers

Many of them come down to preferences, what settings you say, when you need access to the settings, and how often they will change.

As a rule, I try to make my web.config and app.config pretty small. Settings for infrastructure things (for example, modules for loading, linking, log settings, ORM settings, etc.). All I really need or need to have access to App_start or my Main () method, basically.

Something more complex or applicable to a smaller part of the application, etc., I usually do not put in the configuration files, but instead I have settings objects that I insert through my IoC container, or pull them out of the database.

+2
source

1, , , xcopy, web.config.

+1

I would suggest putting the configuration in the database and then extracting it based on the application. You can also write one XML that contains various configurations and upload it to a datagrid, etc. This way of managing your configuration becomes simpler because you have one file to support.

0
source

All Articles