I use a custom interfaces, RemoteCache, with multiple implementations depending 
on the use-case (no-op, spy, whalin, mock).  By changing from memcached to the 
no-op RemoteCacheManager, all remote caching features are disabled 
application-wide.  This is done via the NullObject pattern.  To allow 
dynamically disabling remote caching at runtime the RemoteCacheManager may 
update the clients backing the RemoteCache instances that it hands out.  This 
means that the MemcachedRemoteCache may delegate to a NullMemcachedClient, a 
WhalinMemcachedClient, or a SpyMemcachedClient depending on the scenario.  The 
client is updated based on enablement changes or to a new instance when servers 
are added/removed from the associated pool.

It is very convenient to be able to change the implementation without having to 
update any application code based on performance analysis or other factors.  I 
have custom interfaces for out local caches as well, which are currently backed 
by Ehcache but may switch to a custom lock-free algorithm that I have been 
working on.  This is probably the safest bet for a wire-on / wire-off strategy 
when adopting a new implementation.



----- Original Message ----
From: Nixon Rodrigues <[EMAIL PROTECTED]>
To: memcached <[email protected]>
Sent: Wednesday, September 10, 2008 12:09:58 AM
Subject: How to stop Memcache


I will be using memcache for caching purpose, if i need to revert the
memcaching option at runtime due to some reason,the only option would
be rollbacking the code involving in caching ie caching tag.
Can somebody tell me that is there anyway by which we can switch
memcache off , without
changing the code and will the webapplication still running gracefully

Let me know the other option involved  in case

Nixon



      

Reply via email to