English 中文(简体)
Distributed, persistent cache using EHCache
原标题:

I currently have a distributed cache using EHCache via RMI that works just fine. I was wondering if you can include persistence with the caches to create a distributed, persistent cache.

Alongside this, if the cache was persistent, would it load from the file store, then bootstrap from the cache cluster? Basically, what I want is:

  • Cache starts
  • Cache loads persistent objects from the file store
  • Cache joins the distruted cluster and bootstraps as normal

The usecase behind this is having 2 identical components running on independent machines, distributing the cache to avoid losing data in the event that one of the components fails. The persistence would guard against losing all data on the rare occasion that both components fail.

Would moving to another distribution method (such as Terracotta) support this?

最佳回答

I would take a look at the write-through caching options in EHCache. As described in the link, combining a read-through and write-behind cache will provide persistence to a user-defined data store.

What Terracotta gives you is consistency (so you don t have to worry about resolving conflicts among cluster members). You have the option of defining an interface to your own store (through CacheLoader and CacheWriter or just letting Terracotta persist your data, but I have received mixed signals from Terracotta and documentation on whether TC is appropriate for a system-of-record. If your data is transient and can be blown away at any time (like for web sessions) it might be OK.

问题回答

Adding bootstrapCacheLoaderFactory element along with cacheEventListenerFactory to the Cache(which which needs to bootstrapped from other nodes when it is down & replicates with other nodes if that node got any updates)

memoryStoreEvictionPolicy="LFU" diskPersistent="true"
timeToLiveSeconds="86400" maxElementsOnDisk="1000">





相关问题
Distributed, persistent cache using EHCache

I currently have a distributed cache using EHCache via RMI that works just fine. I was wondering if you can include persistence with the caches to create a distributed, persistent cache. Alongside ...

Oracle Coherence w/ ASP.NET application

Is it possible to use Oracle Coherence to provide distributed caching to an ASP.NET application? We would like to use Coherence to scale out an ASP.NET application which does not have distributed ...

ideas for a distributed cache proxy server

I am implementing, a distributed cache proxy server.I have an idea of the HTTP and related stuff, so i am rather concentrating on the sub part "Distributed data storage". From some search on web i ...

Is SharedCache ready for production?

I ve been comparing distributed caching solutions for an ASP.NET environment and would like to use something FOSS if possible. I ve come across SharedCache and seen it recommended by a few people on ...

Cache Regions in Velocity/AppFabric using WCF

I have a service based architecture where a web farm full of asp clients hit application server farm of WCF services. Obviously all the database access is done by the WCF services. Now I would like to ...

Why does Velocity lose session after only a few minutes?

I ve set up sesion management with Velocity distributed cache. I have 3 servers hosting the cache and created the named cache with new-cache Sessions -Secondaries 1 TTL 1440 and the following is in ...

Distributed caching on 64-bit Windows machines

Are there any production-ready distributed caching mechanisms like memcached that can be used in a Windows 64-bit environment? From what I ve seen, memcached is run on linux machines in production ...

热门标签