Singleton in Cluster environment

前端 未结 9 438
南笙
南笙 2020-12-04 11:23

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

相关标签:
9条回答
  • 2020-12-04 11:57

    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.

    0 讨论(0)
  • 2020-12-04 12:02

    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.

    0 讨论(0)
  • 2020-12-04 12:07

    You could use the DistributedMap that is built into WAS.

    -Rick

    0 讨论(0)
提交回复
热议问题