This is a couple of very basic questions concerning akka. I'm totally green
on akka, so any advice is appreciated.
Say that I have an application with thousands of users - not millions.
The domain model is a hierarchy where each user is located in a region
within a country i.e. a country has multiply regions, a region has multiple
users.
I'm thinking of creating the exact same hierarchy in akka. CountryActor ->*
RegionActor ->* UserActor. The CountryActor could aside from being parent,
also have functional duties such as collecting newsfeeds, calculating
statistics, supervising its children etc. Whereas the RegionActor is only a
parent of UserActors.
*Q1: Does it make sense to mimic the domain model this way?*
*Q2: Should I store the attributes of each entity in the actor?* This way
the data would only need to be stored once and the akka system would
effectively be memory database as well.
(pseudo-code)
CountryActor {
Name,
CountryCode,
(children = list of RegionActors handled by akka)
}
RegionActor {
Name,
RegionCode,
(children = list of UserActors handled by akka)
}
UserActor {
UserId,
Firstname,
Lastname,
Alias,
ReceiveRegionalNews,
ReceiveCountryNews,
...
}
*Q3: How do I efficiently lookup a user by userId?* I expect the child-name
of the UserActor will be the userId, but given that I only have a userId, I
still need to find that correct Country and Region to do a
getContent().findChild(userId)? Do I need to keep a complete map of all
userIds and reference to their actor?
*Q4: How to locate actors by their state?* Imagine that each user has the
ability to switch on a RegionalNews attribute, which means that he wants to
receive news from the RegionalActor. Whenever the RegionalActor want to
distribute news to all listeners, how does it locate them? Does it keep an
internal map of the users with the attribute or does it make a broadcast to
all it's children and then send to all responders?
Thanks in advance
--
>>>>>>>>>> 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.