I'm looking at the viability of using AppFabric as a data cache for our our data. Our data is:
It houses around 100 million members, where one update will affect 2-10 members which would all then need to be updated in the cache; cache would be updated 100k-500k times a day.
My servers have 128gb of RAM.
I have concerns regarding garbage collection and latency with the cache.
Effectively I do not want garbage collection to clear any of the cached data - it needs to live until I refresh it. (We know when the update is required to the cache) Is this possible with AppFabric? Some of this data I want to sit around for days - 1 year at a time.
AppFabric cache was not designed for "Scaling Up" but for "Scaling Out".
Memory is now very cheap and network cards are very fast. AppFabric Cache works well on lower cost machines usually employed for web servers as opposed to database servers which require expensive hardware. AppFabric is IO-bound and not CPU-bound unless you have a huge number of large data items.
Cache size has low impact, except for large caches with high percentage of writes. Among other factors, high write workloads put greater pressure on .NET garbage collection when the size of the managed heap is large.
So, it's better to span multiple medium servers. You will have better latency and you can enable high availability.
Reading your question, I think you are confused about objects's lifetime. AppFabric will remove your object only in two circonstances :
Expiration
When adding an item to the cache, an optional object time-out value can be set for the particular cached object that will determine how long it will reside in cache. It can be turned off for a named cache.
Eviction
As an in-memory cache, AppFabric does not persist the cache to disk. This means that, memory is limited and the cache size cannot grow beyond a certain limit, which could be the total memory available for the server or a configured maximum cache size. When the memory consumption of the cache service on a cache server exceeds the low watermark threshold (70%), AppFabric starts evicting objects that have already expired
What is important here, it that you can't assume an object will stay in AppFabric forever.
Grid Dynamics has completed performance and scalability analysis of Windows Server AppFabric Cache. The data for analysis was collected from a large number of tests conducted with varying usage patterns, workloads, and configuration of the cache. This white paper presents the results of the study and covers some common use cases, which can be used in capacity planning for your application. Download it here and source code here.
Since version 1.1, Appfabric now supports Read-Through and Write-Behind. This may also help you.