Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Clustering and Remoting in Akka

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?

like image 276
almendar Avatar asked Jan 21 '14 09:01

almendar


People also ask

What is Akka remoting?

As explained in that chapter Akka remoting is designed for communication in a peer-to-peer fashion and it has limitations for client-server setups. In particular Akka Remoting does not work transparently with Network Address Translation, Load Balancers, or in Docker containers.

What is Akka clustering?

Introduction. Akka Cluster provides a fault-tolerant decentralized peer-to-peer based Cluster Membership Service with no single point of failure or single point of bottleneck. It does this using gossip protocols and an automatic failure detector.

Is Akka good for Microservices?

In general we recommend against using Akka Cluster and actor messaging between different services because that would result in a too tight code coupling between the services and difficulties deploying these independent of each other, which is one of the main reasons for using a microservices architecture.

What is Akka Microservices?

Akka is an actor-based framework that claims to bring the principles of 'reactivity' into microservices architecture. To a certain extent, Akka's actors can introduce significant benefits to the system, such as high-load tolerance, easy scalability, strong failure resistance and more efficient resources use.


1 Answers

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.

like image 191
Endre Varga Avatar answered Sep 20 '22 18:09

Endre Varga