views:

302

answers:

2

For my .net application I would like to store the configuration data in SQL Server and would like to load it initially and after that refresh the data at regular interval in case there is any change made at database directly. Is there any work/lib already available something 'Centralized Configuration Manager' which could store configuration data of multiple applications.

Else Is there a design pattern which could help me out in designing the solution (Specially refresh part).

Few thoughts I already have on this
1. Create a Configuration Provider (Could be changed back to xml based configuration or extended to other configuration provider)
2. Use SQL Dependency cache to ping the database at regular interval.
3. Can be exposed as WCF service so that multiple applications may use the configuration stored at central location

Thoughts?

A: 

Have you looked at the Enterprise Library's configuration application block?

If you do it yourself, MS SQL 2005+ supports cache invalidation natively, so it can notify your program when cached data is changed.

Robert C. Barth
As per my understanding Configuration block is no more part of new Enterprise Application Blocks. I can get the old one but I am not sure how complex the code would be and fit in my situation. Do you advice to go ahead and check that.
Pradeep Kumar Mishra
+1  A: 

Thoughts regarding #2, though I don't know what version of EntLib or MSSQL you are using/can use.

SQL Dependency in 2005 not only supports polling but a push model too. It'll push to IIS through NDS (notification delivery services) and notify when tables change. That might be a nice option if you have several applications that are dependent upon configuration stored at the same location. Then you get timely updates instead of multiple apps continually polling for changes (i.e. less network chatter).

joshua.ewer