110 likes | 277 Views
Actor Model vs Master Worker. Patterns for Concurrent Reactive Process Design by Emanuele Gherardini (e.gherardini@yahoo.it). Agenda. Who am I ( aka disclaimer ) Why on the earth should we care about this stuff ?! The stuff …. Who am I == !(Who I am not). ! Martin Fowler.
E N D
Actor ModelvsMaster Worker Patterns for Concurrent ReactiveProcess Design by Emanuele Gherardini (e.gherardini@yahoo.it)
Agenda • Whoam I (akadisclaimer) • Why on the earthshouldwe care aboutthisstuff ?! • The stuff…
Who am I == !(Who I am not) ! Martin Fowler ! Joshua Bloch ! Kent Beck ! Robert Martin ! Brian Goetz ! Martin Odersky
Who I am… Really ^_- 31 Yearsold Software Engineer Always a passionate and enthusiaststudent… 6 years of professionalexperience Working @ Ringmaster: System Architect of the GTech Gaming Platform DO NOT BELIEVE ME (tryit!)
Why should I care? Cloudy reasons… http://www.reactivemanifesto.org/ We (devs) nowhavegreattools…
The question is… Do weknowhow to use them ? Probablynot…
Master-Worker Worker Workers are stateless + Self-tunable + Dynamicscalable + Resilient - Sharedmutable staterequiresLOCKS ‘eventX’request ‘eventX’request Worker ‘eventY’request ‘eventY’request ‘eventZ’request ‘eventZ’request Worker Queue Implementationtips: ride the Camel! (and yourpreferreddistributedmessaginginfrastructure) 1 – Create yourroute 2 – Configureit to be local or distributed
Actor-Model • Actors are stateful • + SharedMutable State doesnotexist: no need for complexconcurrency-awarelogic. • Loadshould be • partitionedat design time ifpossible (or implementedusing Router-Actors, etc) ‘eventX’request ‘eventX’request Actor Business Logic ‘eventY’request ‘eventY’request ‘eventZ’request ‘eventZ’request MailBox Implementationtips: Akka
Comparison: whichis the best? Itdepends… The best results come from choosing the concurrency model by the business process. Near-stateless, heavely loaded, business processes Master-Worker Statefull business processes Actor-Model
THANKS Questions?