Alternatives to JGroups
Asked Answered
O

4

16

I want to create a distributed applications on JVM which has a number of nodes, and need a library which allow me to:

  • Manage cluster/grid membership, i.e. I want to get notifications on leave/join
  • Manage messages between cluster members

I have found two solutions:

  • JGroups - it works but it looks dates and not widely used
  • Akka - it's Scala based and its cluster module doesn't look like mature

Are there any other libraries which can do the same?

Orthopedic answered 25/9, 2013 at 19:26 Comment(0)
K
34

JGroups has been around since 1998 and is therefore very stable, not dated at all ! It is being actively developed (I'm the lead dev).

It is used by a lot of applications/systems out there, if you google for it, you'll find a lot of references. Just this week, a telecom company using it broke the record for largest cluster built with JGroups with a 1115 node cluster !

JBoss (Wildfly) clustering (Infinispan) uses JGroups as well. I suggest write a small prototype and see how it performs. If you ask questions on the JGroups mailing list, the people there are very helpful...

I can't comment on Akka, as I haven't used it, but my distaste for Scala would keep me away from it anyway...

Kath answered 26/9, 2013 at 6:8 Comment(3)
I compared number of stars on github and akka has much more of them than jgroups. The number of books and presentations on akka is also larger. That's what I mean by more widely used. You have JBoss projects which uses it, and Akka cluster's initial versions used it as well. I've implemented a simple sharded hashmap with JGroups and it worked quite well, however, I want to choose the best available solution for my app.Orthopedic
While Akka is implemented using Scala it offers equivalent APIs for Java and Scala, which means that you do not even need to know what Scala is in order to successfully use Akka.Amato
JGroups is pretty slow, we had to abandon it. check out this: code.google.com/p/fast-cast, simpler and fasterMent
C
7

Are there any other libraries which can do the same?

Apache Zookeeper. Never used it myself but heard about it.

Personally, I used JGroups for several years. At the beginning it was unstable - my TCP-based cluster of ~ 10 nodes was broken several times per week (separated to subclusters), but later Bela Ban has improved the library, it worked well.

My 5 cents to "JGroups vs Akka":

  • Akka Cluster config is simpler, not so "deep" as JGroups' one
  • Akka Cluster uses non-blocking I/O for communication (currently on top of Netty), JGroups always used blocking TCP sockets (this may be critical for large clusters; but there is also UDP in JGroups... But UDP is not always applicable...)
  • Akka Cluster provides more high-level things like cluster-aware routers & distributed PubSub which are integrated well with Actors (of course if you like Akka & Actors)
  • Akka Cluster covers most of use-cases, but not all: look into our discussion some time ago: https://groups.google.com/forum/#!topic/akka-dev/WUsi6qfV5BU
Cataldo answered 30/9, 2013 at 9:2 Comment(0)
K
5

If you go by the number of stars on GitHub then other projects (Cassandra, Riak, Hadoop etc) would win out over JGroups, too... :-) I'd prototype on JGroups and Aka, and then pick the solution which works best for you (perf, functionality, simplicity etc). Cheers,

Kath answered 26/9, 2013 at 14:38 Comment(0)
S
5

My 2 cents. I have used JGroups in my project to achieve similar requirements. The env is about 60 nodes, which is a bit small, but we have a ton of activity between the nodes (about 1MM messages pd). JGroups has been great, because its network configuration is really flexible and quite stable. There are a few things you might learn the hard way when you configure JGroups for a cluster split over different data centers/LANs and even VLANs, as there is not a lot of user activity on the JGroups, unlike the other newer options that are available now. If you have the time to play around with it and have a comparable QA/Staging env to your production, I think JGroups is a very good option.

Statolith answered 26/9, 2013 at 16:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.