Original Post
Greetings, We have an app written in C# that handles many incoming requests. We use in-memory data caches as part of our request processing for speed. Periodically (every few minutes), we update some of these caches during runtime (they vary in their frequency of updates based on the cache). There are several caches (20-30) that are used in the system given the nature of the data and request processing requirements. Currently, the way we update them is, basically, making a duplicate of the existing caches, applying the update, and atomically swapping out the caches so that its coherence is preserved. This approach can consume quite a bit of memory (2 versions of the cache in memory) and with all the gen-2 objects, can cause issues (note: we also employ object pooling to keep from polluting the generations too much). I am looking for alternate ideas that doesn't involve duplicating the caches. The requirement is that a request, once it has started to process, must be able to complete with all version of the cache data in tact (e.g. old data in one cache can't be used with new data in another cache). TIA