Distributed DAG with Akka

254 views
Skip to first unread message

TJ

unread,
May 12, 2012, 10:20:31 AM5/12/12
to Akka User List
I am looking at Akka to implement a distributed directed acyclic graph
where each node in the graph can potentially be on different vm
instances and hosts. (I have already implemented a more classic
multithreaded version on a single VM in Java).
Nodes are linked to each other and do stuff only when their direct
parents have done their stuff, and so on and so forth. It obviously
all starts from the root node which triggers the whole chain of
events. I need to be able to cater for the diamond type scenario (node
d depends on nodes b and c, both depending on node a).
Going through the Akka documentation, it seems that I could implement
this using several methods:

1. Event Buses
2. Custom Routers
3. DIY with actors

Specifically, how would you implement the following:

4. Dispatch events from the parent node to dedicated remote nodes (the
direct children)
5. Handle the diamond problem (which is easy to do in the same vm)

What would you suggest?

Thank you

Björn Antonsson

unread,
May 14, 2012, 3:29:18 PM5/14/12
to akka...@googlegroups.com
On Saturday, 12 May 2012 at 16:20, TJ wrote:
I am looking at Akka to implement a distributed directed acyclic graph
where each node in the graph can potentially be on different vm
instances and hosts. (I have already implemented a more classic
multithreaded version on a single VM in Java).
Nodes are linked to each other and do stuff only when their direct
parents have done their stuff, and so on and so forth. It obviously
all starts from the root node which triggers the whole chain of
events. I need to be able to cater for the diamond type scenario (node
d depends on nodes b and c, both depending on node a).
Going through the Akka documentation, it seems that I could implement
this using several methods:

1. Event Buses
2. Custom Routers
3. DIY with actors

Specifically, how would you implement the following:

I don't se why you shouldn't go for actors as nodes. It seems very straight forward to me.
 
4. Dispatch events from the parent node to dedicated remote nodes (the
direct children)

This is really no different from creating and dispatching to local actors. Have you looked at the remoting chapter? http://doc.akka.io/docs/akka/2.0/java/remoting.html
 
5. Handle the diamond problem (which is easy to do in the same vm)

I assume that you have some kind of logic for this, the parents knowing about each other, or maybe even some id in the message correlating to which base message that triggered everything so the child can decide when the right number of parents have triggered for a specific base message. This could be encapsulated in a generic joining actor that only sends a message when the correct number of parents have sent a message with that id. Works just as well with local as remote actors.

B/

What would you suggest?

Thank you

--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.
-- 
Björn Antonsson
Typesafe - The software stack for applications that scale

Reply all
Reply to author
Forward
0 new messages