read-write-web / rww-play

read write web Play
59 stars 19 forks source link

issues with hierarchy of actors mirroring the directory structure #73

Open bblfish opened 10 years ago

bblfish commented 10 years ago

Currently the actors form a hierarchy that mirrors the directory structure. Each directory (and metadata) is managed by an LDPC Actor. Each file ( and metadata ) is managed by an LDPR Actor.

• In Akka actors form hierarchies, with a notion of supervision. Does this notion make sense on a file system? Is there some sense to having a LDPC being a supervisor of the files that are in it, and of the subdirectories it contains? (It would be interesting if there were a good reason, as the mapping seems to be made for this )

• Another issue is that if one wants to create actors lazily one needs to create all the intermediate LDPC Actors.

• One cannot send a message directly to an actor currently, without first needing to query for the actors existence . ( or one has to wait for a timeout exception as shown in issue #65). Would there be a way of routing an actor efficiently to an actor without having to deal with this initial query? One solution would be to pass the message to each intermediate actor - but that seems inefficient.

slorber commented 10 years ago

not sure it is inefficient because it's the way they teach us on coursera akka courses on the week5 excercice where we build an actor based binary tree. To query the tree we ask the root node and it propagates the message to the childs.

bblfish commented 10 years ago

The exercises on Coursera are meant more as a way of teaching new concepts. They don't look like they were meant for efficiency. An actor can only parse one message at a time. So that means that the root LDPC would have to parse all messages which would be a bottleneck. The route actor is more of a router. There seems to be a custom router actor that does this very efficiently. Perhaps all LDPCs should be custom routers that either create an LDPC Actor, or that forward the message to the next LDPC actor so as to avoid LDPC bottlenecks.