2

Let’s say I want to create a chat system with Akka.

In the system, I would probably have a UserActor that manages all messages for a certain user.

If I now deploy this in an Akka Cluster, how can I make sure that actorOf gets a (remote) reference to the right UserActor for a certain user? So no duplicates exists on different nodes...

user3612643
  • 5,096
  • 7
  • 34
  • 55

1 Answers1

5

There is Akka Cluster Sharding, which ensures that an actor with a certain Entity ID (like your User ID), exists only once, are balanced in the cluster, and could even be persisted to disk / storage.

StephenKing
  • 36,187
  • 11
  • 83
  • 112