I have a multiplayer game framework that is written on top of akka, and 
there is a recurring problem that to this day I haven't really found a 
'best' solution for.  

I'm going to keep this simple and leave out a lot of the details for now. 
 The core issue is you have up to several thousand clients sending in 
messages at a rate of around every 60ms each, that can result in data 
transformations to itself, or other clients.
The result of these transformations have to be immediately visible to all 
other clients.  When a data structure is updated, the delta that changed is 
sent to a subset of the clients.  The subset is normally all effected 
clients plus all clients in a specific range.  It can be up to the complete 
set, let's say at least several hundred.


So the approach I have been leaning towards, is to use actors to transform 
the data, but to keep a global (per server) cache of that data that other 
actors can read.  Mostly through using ConcurrentHashMap.    A specific map 
has one and only one actor that can mutate it, other actors treat it as 
immutable.  To scale this locally, I would use consistent hashing to 
distribute the map out over several maps (with each node having it's own 
actor).

Persistence is not an issue here as that is already handled by the actors 
responsible for mutating the maps, which send an async update to the 
persistence layer which is designed to handle high write volumes.

I've used this approach already to some extent, but before I really 
formalize it more, I want to get some feedback.

Chris

-- 
>>>>>>>>>>      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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to