tags:

views:

33

answers:

2

Hi,

I need to develop a dedicated caching service ( either a WCF service or a .Net remoting service or other implementation) to cache the data (monitoring data of .net3.5 Latency measuring application) from Database ( SQL Server 2005) which can then be consumed by 2-3 windows services( .net 3.5 WCf services) so that they do not need to call DB repeatedly. So basically it is a additonal level of service layer between these services and DB to reduce the performance penalty of calling DB The data in Database is large and very dynamic (events continously inserted in DB during the day) which we want to cache. Each of the consuming windows service is dependent on another ( one service is retrieving data from one Table in Db and aggegating the data and putting in another table in DB which would then be consumed by another service) . we have the following requirements :

  1. Could have either Push or Pull model for pushing or retrieving data to/from DB and Services.
  2. The cache must reduce the overall impact to the DB and load data by delta, rather than reloading the data completely
  3. The cache data must be updated if the source data in DB has changed. Sql cache expiration policy must be defined.
  4. Should have asynchronous method calls for Data retrieval from DB and cache update to minimise wait times
  5. The cache must support parallel requests to a single DB
  6. CPU and Memory Utilization should be kept at optimum levels so it does not negatively affect other services.

We do not have a clustered or a distributed environment and is not meant to be a very highly scalable solution.

I want to know what is the best way of implementing this based on several technologies available to avoid making it overly complicated:

  1. .Net Framework Caching
  2. Coherence caching
  3. Velocity
  4. Rest based services for WCF

Any suggestions and guidance would be very invaluable.

regards, KK

A: 

If the application server is running on Windows Server 2008 then you can use AppFrabric to do the caching.

Noel Abrahams
That is already mentioned in original question - former name for AppFabric cache is Velocity.
Ladislav Mrnka
+1  A: 

This sounds very elegant but elegancy is not necessarily a good thing. What makes me worried is not the using of caching, it is trying to solve an inherently database problem outside the database - not every company is Microsoft/Oracle/... and has the manpower to make a brilliant database. I believe you have issues with the database perfromance and caching has been put forward as the solution. But it is not a pure cache, it needs to handle data consistency and changes to the data as well as simple reads and you are trying to deal with the data that is often changing and as such is not a good candidate for cache. IMO, this is a call for disaster. Having to implement all database functionality in front of another database it is just not right.

Simplify the database and denormalise. If you still need caching, use ASP.NET caching outside ASP.NET by just referencing it in your project; it has a rich API catering for pretty much any requirement you need.

Aliostad
+1 Very good answer.
Ladislav Mrnka