I have a web application with over 200 configuration settings. These control everything from UI to Business logic.
Should these be retrieved on application startup or when they’re needed?
Should they be injected with an ISettings interface when needed.
Whats your opinions?
Update:
These can be switched on and off in the application so they are stored in the database. Some are per user settings, and some are application wide. Thoughts now?
We have a lot of configuration settings, too. We store them in a central database table. On first access, we load them all from the database and store them in Cache with an absolute expiration of 1 minute. This allows us to have an in-memory copy of our configuration settings, while also allowing us to push configuration updates that we know will be applied in, at most, 1 minute.
So, it’s kind of a hybrid. On the first request for a configuration setting, they are all loaded and stored in Cache. This operation is pretty light-weight, so having it happen every minute is not a big deal for us.
Your mileage may vary.