Slide 1

Slide 1 text

Work  Pulling  Pa-ern   with  Akka     Chris  Cundill   #SSDC  

Slide 2

Slide 2 text

About  Me  -­‐  Chris  Cundill     Java  &  Scala  lead  dev     Worked  on  exciAng  high-­‐scale  projects  with     •  InternaAonal  Baccalaureate   •  Friends  Life  Insurance     •  Money  Supermarket   •  DVLA!     Community  stuff   •  Open  Source  commi-er   •  Organiser  at  local  Tech  Meetup:  #SSDC   •  Speaker;  Scaladays,  Swanseacon   •  Blogger  -­‐  #ThisWeekInScala  

Slide 3

Slide 3 text

Contents   •  Akka   – Intro   – Tour  of  sample  of  projects   •  Work  Pulling  Pa-ern   – The  what  and  why   •  Real  world  applicaAon   – Driver  Data  Batch  Service  

Slide 4

Slide 4 text

ObjecAves   •  Put  Akka  on  your  radar   •  Encourage  use  of  Actor  model  for  concurrency   •  New  pa-ern  for  your  repertoire    

Slide 5

Slide 5 text

Intro  to  Akka   •  Started  by  Jonas  Boner   •  Named  aVer  Swedish  mountain   •  Adopted  by  MarAn  Odersky  &  Typesafe   •  First  release  July  2009   •  Latest  release  January  2015  

Slide 6

Slide 6 text

Intro  to  Akka   •  What?   “Toolkit  and  run.me  for  building     highly  concurrent,   distributed,  and  resilient   message-­‐driven  applica.ons   on  the  JVM.”  

Slide 7

Slide 7 text

Intro  to  Akka   •  Why?   – Building  highly  concurrent  systems  is  hard  with   exisAng  languages  and  tools   – Default  paradigm  of  threads  and  locks  too  primiAve   •  Too  low  level  for  solving  day-­‐to-­‐day  business  problems   – Provides  high-­‐level  programming  model  to  build   highly  scalable  and  fault-­‐tolerant  systems  

Slide 8

Slide 8 text

Intro  to  Akka   ReacAve  Manifesto   Responsive   Resilient   ElasAc   Message   Driven   reacAvemanifesto.org  

Slide 9

Slide 9 text

Intro  to  Akka   Manage  overload  

Slide 10

Slide 10 text

Intro  to  Akka   Scale  up  and  out   Burj  Khalifa,  Dubai   New  Century  Global  Centre,  Chengdu,  China  

Slide 11

Slide 11 text

Actor  Model   Intro  to  Akka  

Slide 12

Slide 12 text

Actor  Model   Intro  to  Akka   “…actors…  view  them  as  persons  …envision  a   group  of  people  and  assign  sub-­‐tasks  to  them…all   with  the  benefit  of  not  actually  dealing  with   people,  which  means  that  we  need  not  concern   ourselves  with  their  emo9onal  state  or  moral   issues.”   Akka  DocumentaAon  Chapter  2  Paragraph  2  

Slide 13

Slide 13 text

JVM  Concurrency   Intro  to  Akka   X

Slide 14

Slide 14 text

JVM  Concurrency   Intro  to  Akka   X

Slide 15

Slide 15 text

JVM  Concurrency   Intro  to  Akka   X

Slide 16

Slide 16 text

Actor  Concurrency   Intro  to  Akka   J

Slide 17

Slide 17 text

Intro  to  Akka   •  The  Actor  Model   State   Behaviour   Actor   Mailbox   Akka runtime enforces that an Actor only processes one message at a time

Slide 18

Slide 18 text

Intro  to  Akka   ActorRef   LocaAon  transparency;  fundamental  to  scalability  

Slide 19

Slide 19 text

Intro  to  Akka   ActorRef   Local     Remote   Routed   …  

Slide 20

Slide 20 text

Intro  to  Akka   Tour  Sample  Projects  

Slide 21

Slide 21 text

Intro  to  Akka   typesafe.com/get-­‐started  

Slide 22

Slide 22 text

Work  Pulling   Pa-ern   michaelpollmeier.com/akka-­‐work-­‐pulling-­‐pa-ern  

Slide 23

Slide 23 text

Work  Pulling  Pa-ern   •  Modern  management  style   •  Laissez-­‐faire  (lit.  “Leave  do”)   •  Empowering   •  LiberaAng  

Slide 24

Slide 24 text

Work  Pulling  Pa-ern  

Slide 25

Slide 25 text

Work  Pulling  Pa-ern  

Slide 26

Slide 26 text

Driver  Data   Batch  Service  

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

Show  me  the  code  

Slide 29

Slide 29 text

Q&A