I have several WCF services on a webfarm and they capture every single request object sent to them and cache it, and write it to DB once a specified amount of requests is reached. This is done so that I minimize calls to the DB. I am not using AppFabric caching for it, I am using the in-memory cache which means the cache is separate for each node. It all works fine.
I want to install AppFabric on the server and write the requests to that cache. Now my question is can I do some sort of programming (a DLL perhaps) on AppFabric itself, which periodically reads from this cache, writes to DB and flushes it out? So that all my services will do is to put the requests on cache. This will enable my services to perform better.
Is this even possible?
Yes, AppFabric already offers Write-Behind technique where your create an assembly that implements the DataCacheStoreProvider abstract base class and register it on AppFabric and then you write items to the cache and on an interval basis the items added, update will be written to the backend database according to your provider implementation.
To get more details about creating the provider check the following link