1

I remark that for my project I really need often something to manage a cache of our data(for data access performance, for offline work, ...).

So I was asking me if there was something which could respond to my needs or if I will have to create my own framework for this. It can be only a "Core" which furnish the logic, and we have to implement the business part.

My needs are:

  • Data sources can be WCF/Web service/...(this part should be implemented on every new project
  • It has to manage an store of data available
  • This store must be refreshed regularly by polling the service
  • This store can be persistent(write cache on disk for the next start)
  • The framework must allows modifications, online and offline, asynchronous and synchronous(if online)
  • It has to run with c# 4.0
  • If the local cache store can be accessed through LINQ, it would be great(like directly through a list
  • The concurrency has to be managed(or offer us a way to manage it)
  • The use/configuration of this framework should be shorter than implement myself it every time

So here we are, do you know a tools which can fits into my query?

Somebody tell me that MS entreprise library should have something like that, but I didn't found anything.

Thank you!

J4N
  • 19,480
  • 39
  • 187
  • 340

2 Answers2

2

You could have a look at

Windows Server AppFabric. It used to be called 'velocity'.

It is a distributed in-memory application cache platform for developing scalable, high-performance applications.

Otherwise, the Enterprise Library Caching Application Block you're talking about is here: The Caching Application Block however, this page says:

Caching Application Block functionality is built into .NET Framework 4.0; therefore the Enterprise Library Caching Application Block will be deprecated in releases after 5.0. You should consider using the .NET 4.0 System.Runtime.Caching classes instead of the Caching Application Block in future development.

And actually, the System.Runtime.Caching Namespace is a very good building block to build on if you're going to write something by yourself. I don't think it implements the notion of distributed cache, that's why Windows Server AppFabric exists.

Now, there is also non-Microsoft technologies available in the .NET space. Have a look a memcached and .NET implementation or usage:

You also have commercial packages available, like NCache (I'm not affiliated). I don't know what they provide, but it's also probably interesting to have a look at it, just to be aware what they provide, to ensure you don't miss any feature you'd need later one.

Community
  • 1
  • 1
Simon Mourier
  • 132,049
  • 21
  • 248
  • 298
  • Thank you, your links seems to be interessting. In my case, I've the impression that what fit the most my needs is the System.Runtime.Caching classes. But I've one question on them: They only manage the cache? Or they also manage to make refresh when possible? And have a buffer for outgoing changes, .... ? – J4N Oct 04 '11 at 10:58
  • @J4N -have a look at the CacheItemPolicy for expiration. – Simon Mourier Oct 04 '11 at 11:50
0

Have a look at SharedCache.

Aliostad
  • 80,612
  • 21
  • 160
  • 208
  • Did you find any client-server exemple code? I found the sandcastle documentation and the commercial description but it doesn't helps me to see what I will have to do to use it and what possibilities it offers me. – J4N Mar 14 '11 at 12:28
  • I have never used it I am afraid. – Aliostad Mar 14 '11 at 12:43
  • And it seems it manage only the part of caching, which isn't the main part of my problem – J4N Mar 16 '11 at 08:32