What is the best strategy to refactor a Singleton object to a cluster environment?
We use Singleton to cache some custom information from Database. Its mostly
I'm facing a similar situation, but I'm using Oracle's WebLogic and Coherence.
I'm working over a web application that uses an hashmap with cached data read from the database (text to show on webform's labels). To accomplish this, the developers used a singleton instance where they stored all this information. This worked well on a single server environment, but now we want to go into cluster solution and I'm facing this issue with this singleton instance.
From what I've read by now, this is the best solution to accomplish what I want. I hope this helps you with your problem, too.
Or something like memcached
http://www.danga.com/memcached/
What is memcached? memcached is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.
Danga Interactive developed memcached to enhance the speed of LiveJournal.com, a site which was already doing 20 million+ dynamic page views per day for 1 million users with a bunch of webservers and a bunch of database servers. memcached dropped the database load to almost nothing, yielding faster page load times for users, better resource utilization, and faster access to the databases on a memcache miss.
You could use the DistributedMap that is built into WAS.
-Rick