Reputation: 995
The actor based paradigm is pretty cool. Its ability to scale effectively makes it a paradigm to must-evaluate for any concurrent system. I have done some reading about it, and have a decent idea about the core intent: drive your expensive operation with messages and multiple "actors" to minimize waits due to request/response interactions thereby increasing the throughput of your system. However, I have not had sufficient exposure to the design patterns people use with actors. I am looking for design patterns for actor based systems.
A common example of an actor design pattern is a system where there is a master-coordinator actor and a bunch of child worker actors. They master maps the expensive operation to smaller chunks, sends the smaller chunks as messages to the bunch of workers, waits for responses from them and then reduces them all to the result. In some sophisticated examples of this pattern , the worker actors notify the master that they are ready for more work, and the master routes to them more work on demand. This ensures proper balance of work and is useful when job sizes vary quite a bit.
I searched around for literature on more actor based patterns and couldn't find any examples other than the one above yet. I am yet to go through Akka Actors project samples, but any pointers would be very useful.
Upvotes: 9
Views: 4886
Reputation: 3753
I just gave a more elaborate answer to a similar question, but I will summarize here the resources I found most interesting regarding the Actor model.
Design Patterns:
Reactive Actors & DDD:
Proto Actor (project by one of Akka's creators with help from Alexey Zimarev). I find this project easier to comprehend than Akka, which is very elaborate (I have no affiliation to them, but considering use):
And then searching on Github actor-model topic may yield interesting stuff.
Some more book recommendations I found in the QCon Video Actors or Not: Async Event Architectures:
Upvotes: 2
Reputation: 20515
It's worth mentioning the work on Enterprise Integration Patterns (http://www.eaipatterns.com/) here. It's entirely possible that the word "actor" is never mentioned in their work, but the translation from queue processors to actors is trivial, like translating Poe from English to French. Patterns for load balancing like you describe are the least of what you'll learn there.
Upvotes: 1
Reputation: 7320
I highly recommend Derek Wyatt's "Akka Concurrency" book - it is focused on the latest Akka distribution (2.1) and goes over several best practices of using Akka and lots of design patterns (emphasizing event-driven design). It does assume a fair bit of knowledge in Scala however.
The posts from the Akka Summer of Blog series is also really helpful (several of them are also written by Derek [and one by me]).
Upvotes: 11
Reputation: 995
I found some more literature on event-based-programming.
http://www.amazon.com/Event-Based-Programming-Taking-Events-Limit/dp/1590596439/ref=pd_rhf_ee_s_cp_8
The chapter on event based interaction patterns seemed promising
Upvotes: 1
Reputation: 13525
First, get familiar with http://en.wikipedia.org/wiki/Flow-based_programming and http://en.wikipedia.org/wiki/Dataflow_programming. Actor model is a subset of datatflow programming, and actor model implementations are even more restricted.
Upvotes: 4