tags:

views:

22

answers:

1

I have a cache service,it's works as .net remoting, i want to create another windows service to clean up the that cache service by transfer the objects from cache to files. because they are in separate process, is their any way i could access that cache service or do i have to expose a method from the cache service to do that clean up work?

the "clean up" means i want to serialize the object from Cache to file and these saved file will be used for further process.

let me explain this application more detail. the application is mainly a log service to log all the coming request and these request will be saved to db for further data mining. we have 2 design for this log system 1) use MSMQ, but seems it's performance is not good enough, we don't use it. 2) we design a cache service, each request will be saved into the cache, and we need another function to clean up the cache by serialize the object to file.

A: 

If I follow this correctly then 'yes', you will need to modify the Cache to either

(a) expose a mechanism that would trigger "cleanup" from within the Cache process itself. In this scenario the cache would have all the knowledge required to create the file, serialize objects into the file, and then remove the objects from the cache. This option makes sense if you want the operation to be atomic.

(b) expose a methanism that would allow the external cleanup service to receive cached objects so it can do all the serialization, persistance to file, etc. This could be accomplished by some form of publish/subscribe, continuous query, etc. The cache would also need to expose methods that would allow the cleanup service to signal a request to remove cached objects that have been sent to file.

(c) make cleanup an inherent function of the cache... In the Cache/Data Grid world this is really common and is often refered to as write-behind or backing store support.

In any case, you will have to change the cache if it does not already expose methods to put (e.g. write/cache), read/take, and/or remove.

Strictly speaking you do not need Remoting for any of this so don't feel constrained to this. Remoting is nice but you have to know that it is expensive on-the-wire. in memory, and in Garbage Collection.

JoeGeeky