How to handle million individual actors with AKKA Cluster setup?

300 views Asked by At

I have a use case which is million clients data processed by individual actor.And all the actors created on across multiple nodes and formed as a cluster.
When i receive a message i have to send it to the particular actor in the cluster which is responsible for.How can i map to that actor with AKKA cluster.I don't want it to send to other actors.
Can this use case achievable With Akka - Cluster?
How failure handling will happen here?
I cant understand what cluster singleton is,saying in doc that it will only created on oldest node. In my case i only want all million actors as singleton. How particular actor in cluster mapped with message?
How can i create actors like this in cluster?

1

There are 1 answers

4
Levi Ramsey On BEST ANSWER

Assuming that each actor is responsible for some uniquely identifiable part of state, it sounds like you want to use cluster sharding to balance the actors across the cluster, and route messages by ID.

Note that since the overhead of an actor is fairly small, it's not implausible to host millions of actors on a single node.

See the Akka JVM or Akka.Net docs.