I am looking for a C # object cache library that can implement the following patterns:
- cache is used to cache objects of a certain type T having a primary key. Example: Person class (with first name, last name, etc.), and the key is PersonId
- The cache can store an unlimited number of keys. The keys are of type int or long.
- the cache, however, can only store a limited number of objects of type T. T objects take up a lot of memory, and I cannot have many of these objects in the cache at a time.
- when overflowing, the cache can serialize objects to a database or file, etc. (fast media), but the cache will still store keys.
I basically need to process more T objects than I can store in memory, and I want to use the cache to quickly find them before storing the results in a database.
So, I was thinking about using a Proxy template and had cache proxy objects that can receive / serialize my real objects.
Do you know any C # caching library that can be used with these templates? I myself could not find anything.
thanks
source share