+ All Categories
Home > Technology > Actor Model vs Master Worker micro talk @JUGRoma Nov2013

Actor Model vs Master Worker micro talk @JUGRoma Nov2013

Date post: 15-Jan-2015
Category:
Upload: egherardini
View: 147 times
Download: 1 times
Share this document with a friend
Description:
My micro-talk about some differences between Actor Model and Master Worker patterns for business process design.
Popular Tags:
12
Patterns for Concurrent Reactive Process Design by Emanuele Gherardini Actor Model vs Master Worker
Transcript
Page 1: Actor Model vs Master Worker micro talk @JUGRoma Nov2013

Patterns for Concurrent Reactive Process Design

by

Emanuele Gherardini

Actor Modelvs

Master Worker

Page 2: Actor Model vs Master Worker micro talk @JUGRoma Nov2013

Agenda

Who am I (aka disclaimer)

Why on the earth should we care about this stuff ?!

The stuff…

Page 3: Actor Model vs Master Worker micro talk @JUGRoma Nov2013

Who am I == !(Who I am not)

! Joshua Bloch

! Robert Martin

! Kent Beck

! Martin Fowler

! Martin Odersky ! Brian Goetz

Page 4: Actor Model vs Master Worker micro talk @JUGRoma Nov2013

Who I am… Really ^_-

31 Years old Software Engineer

Always a passionate and enthusiast student…

6 years of professional experience

Working @ Ringmaster:System Architect of the GTech Gaming Platform

Page 5: Actor Model vs Master Worker micro talk @JUGRoma Nov2013

Who I am… Really ^_-

DO NOT BELIEVE ME(try it!)

Page 6: Actor Model vs Master Worker micro talk @JUGRoma Nov2013

Why should I care? Cloudy reasons…

http://www.reactivemanifesto.org/

We (devs) now have great tools…

Page 7: Actor Model vs Master Worker micro talk @JUGRoma Nov2013

The question is…

Do we know how to use them ?

Probably not…

Page 8: Actor Model vs Master Worker micro talk @JUGRoma Nov2013

Super-Simple-Use-Case: online tickets

Page 9: Actor Model vs Master Worker micro talk @JUGRoma Nov2013

Master-WorkerWorkers are stateless+ Self-tunable+ Dynamic scalable+ Resilient

- Shared mutable state requires LOCKS

Worker‘eventZ’request

Queue Worker

Worker‘eventX’request

‘eventY’request

‘eventX’request

‘eventY’request

‘eventZ’request

Implementation tips: ride the Camel!(and your preferred distributed messaging infrastructure)

1 – Create your route

2 – Configure it to be local or distributed

Page 10: Actor Model vs Master Worker micro talk @JUGRoma Nov2013

Actor-Model

‘eventZ’request

‘eventX’request

‘eventY’request

‘eventX’request

‘eventY’request

‘eventZ’request

Business Logic

MailBox

Actor

Implementation tips: Akka

Actors are stateful+ Shared Mutable State does not exist: no need for complex concurrency-aware logic.

- Load should bepartitioned at design time if possible (or implemented using Router-Actors, etc)

Page 11: Actor Model vs Master Worker micro talk @JUGRoma Nov2013

Comparison: which is the best?

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

It depends…

Page 12: Actor Model vs Master Worker micro talk @JUGRoma Nov2013

THANKS

Questions?


Recommended