Search code examples
scalaakkacluster-computingactorhigh-availability

How does Akka 2.4.x work in A Cluster Application when I loose one of my nodes


My application has a set of Actors, each one doing some heavy computation, and each one executing a different business logic. At the end each actor sends the result back to the Supervisor that in turn persist the data.

My intention is to have them distribute in 3 nodes to split/balance the workload, as well as make the system high available, by allowing on of the machines "die".

  • There is no need to share state among the machines

How does Akka solve for this scenario?

Is it an Akka cluster that I need?

Are there any examples that fall in this domain?


Solution

  • To share state between instance you can use Sharding and PersistentActor. You can play Reactive Missile Defend project to visualise what happened if node goes down.

    There are nice talks on JDD2015 Sharding with Akka. From theory to production and Scala eXchange - Beat Aliens with Akka Cluster showing how to use distributed Actors (with Cluster and Sharding) and how they behave in situation of turning off one of the nodes.