Domanda

I have developed my application with Akka on a single JVM. Now I want to distribute the workload across many machines. I've started to read the documentation and got confused.

There are two ways of making Akka app to be distributed by clustering and remoting. I don't get the difference between the two. If I understand properly both are excluding themselves mutually since in configuration one need to use different provider for actor reference:

 akka.remote.RemoteActorRefProvider
 akka.cluster.ClusterActorRefProvider

So what are the use cases? When I would choose one instead of the other?

Maybe clustering is something like superset of remoting or maybe it is the other way around?

È stato utile?

Soluzione

They are not mutually exclusive since clustering is implemented on top of remoting. The main feature of remoting is location transparency for ActorRefs. Clustering adds distributed membership on top of that. It is rarely useful to use remoting directly, clustering is preferred for most of the use cases.

Altri suggerimenti

Always best to look to the code

https://github.com/akka/akka/blob/c2983c7225eeaa035af99e0affeb5f5c841668c4/akka-cluster/src/main/scala/akka/cluster/ClusterActorRefProvider.scala

private[akka] class ClusterActorRefProvider ... extends RemoteActorRefProvider

First of all ClusterActorRefProvider is just extension of the RemoteActorRefProvider

Core features of the cluster-akka added to the remoting are:

  • cluster wide failure detection
  • routers with rootes group & pool capabilities

you'll find flavour of all this addons in the source code.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top