0

We have various windows services that load up a large amount of data i.e. mostly settings, from a database into an object which is used whenever calls are made to our various .net remoting functions (I know it's old!!). Having this object containing all these settings in memory saves us having the query the database constantly or load the data from a cache whenever queries are executed.

Settings in this "large" object are collections of data, from id, path, text, etc...

We want to move away from .net remoting to wcf and potentially get rid of our windows services and run the lot under IIS (and eventually Azure), but being stateless, I'm wondering how should we handle this?

1) What's the best method you can think of? From experience preferrably.

One suggestion that was made to me was to return all of this to the client, cache it and use only the relevant settings when making a wcf call.

2) Numerous services we have are polling services, constantly monitoring, databases, file locations, ftp locations, etc... How would you recommend to handle this in a stateless environment?? I can't see how this will be handled.

We use SQL Server, but I don't want to rely too heavily on the build-in features as we could potentially have to suppor the likes of mySQL & Oracle.

Thanks.

Thierry

Thierry
  • 6,142
  • 13
  • 66
  • 117

1 Answers1

0

You could store these settings in the AppSettings section of the config file (Web.config for IIS). Using the ConfigurationManager class, you can retrieve the relevant values as needed.

If you prefer to store a static instance of your settings object, suggest implementing a Singleton pattern for the same. Jon Skeet's article is a great starting point.

Hope this helps.

Channs
  • 2,091
  • 1
  • 15
  • 20
  • Using Appsettings won't work. There are just too many objects, dictionaries, lists, etc.... As for the singleton pattern, it is already being used at the moment, but I'm trying to move away from it. We have this large object which stores all this information and it's being shared by various windows services, workflows, etc... and if we ever want to move to a stateless environment, we'll have to figure out how to access these differently rather than loading the lot in memory but reading all these settings from sql server every time is just not an option.. Curious to see how it can be done. – Thierry May 14 '13 at 21:29