In my view, you'll have to prioritize user actor discovery or locality. I don't think you can get sharding to bring up an actor on an arbitrary node.
The reason for my previous response was you have a 1:n relationship between geographies and users, making instantiated users ideal child actors at runtime. As far as fast discovery of user actors instantiated in this manner, if I wanted faster resolutionS of users Sent from my iPhone > On Dec 10, 2017, at 23:04, Arno Haase <[email protected]> wrote: > > Hi Brian, > > thanks for sharing your ideas. > >> Am 11.12.2017 um 01:13 schrieb Brian Topping: >> What if you kept the shard for the geographies and removed it for the >> users, keeping the latter persistent all the same. Then spread the >> persistence configuration for users across the cluster (I use ZK for >> this). The user could then be restored as a child of the geography by >> the sharded geography actor, on that same node. >> >> A basic implementation would require that the user actor was on one >> node at a time. You might want some security against the user actor >> being started in multiple geographies. It might be completely >> reasonable for the user actor to be multiply available like that, >> maybe by wiring distributed PubSub into the persistent user actor >> event loop. I haven’t thought though the scalability or performance >> of this, just offering ideas. > > Starting player actors as children of geographical regions would provide > locality, and making them PersistentActors would allow (re)starting them > on a different machine as needed. > > But that leaves me without all the good stuff that Akka Cluster Sharding > provides: > > * Efficient (in terms of latency and bandwidth) lookup of where a > specific player actor currently "lives", i.e. sending a message to it > based on the player's ID > > * Ensuring uniqueness while migrating to a new node, > > * while ideally minimizing loss of messages while doing so. > > The algorithms used in Cluster Sharding rely on a stable mapping from > entityId to shardId. I am looking for a way to get as close as possible > based on a mutable mapping that changes infrequently. > > - Arno > > PS: What is ZK? I googled it but found only a web framework by that name. > > -- >>>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>>> Check the FAQ: >>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to a topic in the Google > Groups "Akka User List" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/akka-user/_ogMHnVWm78/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
