Configurations : Web Config or Database?

Configurations : Web Config or Database?

Web Config:
Database Connection Strings. OfCourse. You can’t connect without that details.
Changes you want trigger Application Pool refresh.
Things need to be available when the database is unavailable.
(such as a list of email addresses and an smtp server to send error messages to, Support Information,etc)

Simple configurations like a local file system path, logging level, or database connection strings go in the web.config. The reason is that these deal with resources specific to that machine.

Modifications to the web.config file will trigger the worker processes on IIS to recycle and
the app to be re-started.
If you are using InProcess sessions, those will be lost.
This could potentially disrupt your website users.

Database:
Ability to change the configuration on the fly, without forcing an application pool refresh.
Coordination between multiple teams. Usually companies have Database Team and Application teams.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *