0
votes

I am trying to understand how clustering works in Akka. Specifically I'm interested in two different types of clustering:

  • Heterogenous nodes, where each "node" (JVM) in the cluster contains a mixture of different Actors; and
  • Homogenous nodes, where each nodecontains all the same types of Actors

enter image description here

Above are examples of what I mean by heterogenous and homogenous nodes. In the first (top) diagram, an all-actors.jar is deployed to three machines: myapp01, myapp02 and an AWS machine. In the second (bottom) diagram, 3 different types of Actor Systems are deployed; 1 to each machine. The heterogenous model has the benefits of simplicity and makes the Actor System as a whole scalable. The homogenous model allows for finer-grained elasticity (perhaps we need 3x more "B" Actors than "A" or "C", etc.).

  1. Are both types of clustering (heterogenous and homogenous) supported by Akka? If not, what would be needed (added on top of existing clustering) to obtain these clustering strategies? If so, how is each type configured?
  2. Is it possible to control the number of Actors you want in each node? Is it possible to say "On myapp01 I want 500 A-Actors, 200 B-Actors and 1,000 C-Actors"? Or does Akka just respond to messaging demand and scale up/down the various Actors automagically?
1
Nobody on SO has ever used Akka clustering before?!? - smeeb

1 Answers

0
votes

After doing some digging, it turns out the Akka clustering has nothing to do with clustering Actor Systems across JVMs, but it essentially keeps the data of each Actor in a synchronized, in-memory cache so that if the thread executing the Actor is interrupted or dies, the Actor's data can be used to regenerate a new thread running the same type of Actor.

So Akka Clustering is like Eraser but instead of for Hollywood actors, for Akka actors.