Caching Block for a large cache

Topics: Caching Application Block
Apr 2, 2011 at 2:06 AM

I have seen documentation on using a backing store to enable a cache to persist across process restarts etc. My question is this, "Is there an advantage in using a backing store to save on memory?". Hypothetically say I want to cache thousands of very large objects and I don't want the overhead of keeping them in memory. Will the cache manager still keep instances in memory up to the limit of the number of items configured for the cache? If so can this behavior easily be changed? Can the cache be 'flushed' to the backing store and have the memory occupied by the objects in the cache freed? Can there be kind of a "batch" of items in memory with the rest in the backing store?

Apr 4, 2011 at 3:03 AM

"Is there an advantage in using a backing store to save on memory?"

- I assume you're referring to how the caching application block works where it still uses an in memory cache even when using a persistent backing store, am I correct?  If yes, then the advantage will be the fact that when you're retrieving an object from the cache, especially when using a database backing store, the code will no longer need to go to the database itself but rather rely on the in memory cache. This saves you from creating a database call.

And yes, the cache manager will still keep the number of items  configured for the cache. 

"Can there be kind of batch of items in memory with the rest of the backing store?"

- Currently, this isn't supported.  You would have to create a custom implementation of a backing store.

 

Sarah Urmeneta
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com