14

I am looking for a java distributed caching solution. We would like features likes:

  • Distributed
  • Auto-Discovery
  • Redundancy
  • Non-Centralized

We've analyzed a framework like TerraCotta which seems to be everything we would ever want from a caching framework... However, there seems to be a central caching node(s) that is required which become our single-point-of-failure.

Any ideas other than rolling out our own solution?

skaffman
  • 398,947
  • 96
  • 818
  • 769
Claude Houle
  • 41,064
  • 8
  • 33
  • 42
  • Terracotta does not have a SPOF - you can use as many hot backups as you want that take over when an active server dies. With Terracotta FX, you can even have multiple actives for greater scale. – Alex Miller Nov 10 '09 at 02:31

8 Answers8

16

Try Hazelcast. It is an open source clustering and highly scalable data distribution platform for Java. It fulfills all your requirements. Plus it is super easy to use.

Fuad Malikov
  • 2,325
  • 18
  • 20
  • In the event of a network partition, does Hazelcast favour consistency over availability in the CAP theroem (https://en.wikipedia.org/wiki/CAP_theorem)? – Derek Mahar Feb 21 '18 at 16:22
  • @DerekMahar Hazelcast 3.12+ can be configured as AP or CP depending on your need. https://hazelcast.com/blog/hazelcast-imdg-3-12-introduces-cp-subsystem/ – Abhijit Sarkar Sep 12 '19 at 01:33
8

I suggest either JBossCache or EhCache (with a distributed cache listener). I've used both, I like both, and they both fit your requirements.

skaffman
  • 398,947
  • 96
  • 818
  • 769
4

Try Infinispan . Infinispan cache can be used as distributed cache and also can be used as Replicated cache . There is no possibility of Single Point Failure . In distributed cache mode it can provide more space than Heap Size. Consider there is 4 node in cluster each with 1GB Heap Size and Infinispan use as Replicated cache then total size cluster has 1 Gb but if Infinispan used as Distributed cache and set 2 copy per data item then total size will be 2Gb . http://www.jboss.org/infinispan

Hitesh
  • 375
  • 6
  • 17
4

Terracotta recently acquired Ehcache and has released a tight integration of the Ehcache API with the Terracotta clustered store in a simple package and only requires a few extra lines of Ehcache configuration to go from single node to clustered, although you also have to run the Terracotta server process.

Ehcache with the Terracotta ES edition is open source and free to use. Commercial licenses are available if you want support, more scaling, indemnification, patch support, etc.

Terracotta does use a central server array, not a single central server, so there is no single point of failure! You can set up as many hot backup servers as you want and these backup servers can be configured to take over when the active server goes down. With Terracotta FX (commercial product), you can also use multiple active servers.

Alex Miller
  • 69,183
  • 25
  • 122
  • 167
  • 1
    The issue with TerraCotta is that in order to have no single point of failure, you require at a bare-minimum 4 machines (or JVM): - 2 for your App - 2 for TerraCotta I'd rather have 4 JVM for my app but with in-JVM caching clustering. – Claude Houle Dec 16 '09 at 19:16
2

Have you looked at Coherence?

We have found it very useful. It is not open source or cheap though.

http://www.oracle.com/technology/products/coherence/index.html

andy boot
  • 11,355
  • 3
  • 53
  • 66
1

Normally single point of failure occurs when all the operation are done on a single node and if that node goes down, the whole operation can go down. the solution of this problem is to use topology like Replica or partition replica. if once node goes down, the whole operation will shift to an other node without any kind of data lose.

as far as the features which you are looking can be found in a single product, NCache,as Umer has also mentioned.

Jammy
  • 31
  • 1
1

I'm late to the party but have you tried TayzGrid, an open source java distributed cache. Also known as in-memory data grid or key value store.

It answers all your basic needs

- Distributed
- Auto-Discovery
- Redundancy
- Non-Centralized

It also manages advanced failover scenarios like split brain and sudden restarts. All nodes are intelligent therefore completely distributed.

You also can also make a choice of which topology you want to use (Partition or replicated). If you want to use more advanced topologies(Partition of replica) then you can maybe buy a license.

Basit Anwer
  • 6,742
  • 7
  • 45
  • 88
0

Terracotta also offers a distributed cache.

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820