I haven't been following the conversation closely, so I may be missing nuances, but I'd generally implement something like that using Cluster Sharding instead of pubsub. That's well-suited to having one Actor per topic, with all nodes in the cluster able to easily access it. (Indeed, I think of named chatrooms as more or less the canonical example of when to use Cluster Sharding, maybe with Persistence...)
On Tue, Dec 29, 2015 at 6:05 PM, <[email protected]> wrote: > This is a continuation of the thread Aggregate counts in multi-jvm testing > <https://groups.google.com/forum/#!topic/akka-user/3LbOxIXkfTA> (we got > derailed there, and the topic became rather unrelated to the subject line > :). Below is a copy of my last post on that other thread > > @Konrad: Great! It seems that I totally misunderstood what I saw in the > akka source (which I only took a cursory look and jumped to conclusion too > quickly). > > So just to confirm my understanding: suppose I have a topic named "apple", > then pubsub only sends the subscription data of "apple" to nodes with > "apple" subscribers? From the source, I see that on each node, there's a > Topic actor that takes care of local subscribers (and maybe this is what > you refer to as co-location?) But then, a Publisher can be on any node, > and still needs access to the list of Topic actors. So this list of Topic > Actors must then be replicated across the cluster, right? > > So it seems like if the number of topics is small and and the number of > subscribers for each topic is large, then this is an efficient way of doing > things. However, if the number of topics is large, and each topic might > only have a couple of subscribers (for eg, in the chat example, each topic > for each user) then a large amount of data (i.e. list of topic actors) has > to be replicated across the cluster? As a general question, is pubsub the > right tool to deal with this kind of problem? > > I'm a complete newbie (only started with akka recently), and your answers > have been great help. Thanks a lot! > > -- > >>>>>>>>>> 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. > -- >>>>>>>>>> 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.
