Are these values ​​used in the configuration file or database?

There are several values ​​that I saved in the ASP.NET configuration sections for each “module”. I was wondering if they even belong to these files at all.

Background stands on: These are several instances of a deployed web application. All use the same database, but have their own settings.

I am sure that the differences between development and production go to the configuration files. Some of the values ​​I know should include: connection strings, providers to use, debugging installation, etc.

I have equipped all the common parts in the classes with my own rules and methods. The remaining parts are different settings for each module on each site. Some of the options I'm not sure about include:

  • For ModuleA, Show / Hide Option
  • For ModuleB, what is the terminology that will be used for this field.
  • For ModuleC, allow the end user to perform step X
+6
web-config configuration-files
source share
4 answers

Mmm this sounds like things you might want to change at runtime for your application without changing app.config. One rule of thumb that I like is that the configuration should have everything you need to configure your deployment or server. In this case, your settings seem to change the behavior of the application, and therefore I would probably move them to the DB if it is not so much effort.

+4
source share

ModuleA and ModuleC sound as if they could be user profile information. If they are not dynamic for the user, but you can add later functions, then perhaps move them to the database.

I wrote applications where ModuleB would also be added to the database. Things like form shortcuts, etc., can easily enter the database. If later, someone decides to add or remove colons to all form labels, this is a fairly simple task if all the text is stored in the database.

+1
source share

Consider a situation where you need to edit one of the values.

If the value is specified in the web.config file, saving changes to this file will lead to the processing of the application, inconveniently throwing current users away. There is not much of a problem if your application is on an intranet that is only used during business hours (although you may get an angry call from a guy who has stayed up late). But potentially a problem on a public website with international users.

If the value is in the database, it will not affect the processing of the application in this way.

In any case, consider whether the values ​​are cached in the application RAM (web.config is). Are the database values ​​in the application variable or in the cache? If so, you may not know when the change will occur. If you do not want to restart the application.

And what other access and permissions should the appropriate administrators have to make to make changes? Someone must have access to the web server (s) in order to modify web.config or the database (and table) in order to change this.

+1
source share

A few questions: why are you using the same database for multiple instances of the application and how will this affect maintanence? In the future, will it be possible to split db to improve performance? Does it support a configuration model that better changes the database based on the database?

In other words, you will need to consider a lot of variables to answer your question :-)

0
source share

All Articles