Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Work Pulling Pattern with Akka

Work Pulling Pattern with Akka

A brief intro to Akka and the Work Pulling Pattern to scale up safely by throttling throughput. Presented at http://www.meetup.com/Swansea-Software-Development-Community/events/220090811/

Chris Cundill

April 27, 2015
Tweet

More Decks by Chris Cundill

Other Decks in Programming

Transcript

  1. 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  
  2. Contents   •  Akka   – Intro   – Tour  of  sample

     of  projects   •  Work  Pulling  Pa-ern   – The  what  and  why   •  Real  world  applicaAon   – Driver  Data  Batch  Service  
  3. ObjecAves   •  Put  Akka  on  your  radar   • 

    Encourage  use  of  Actor  model  for  concurrency   •  New  pa-ern  for  your  repertoire    
  4. Intro  to  Akka   •  Started  by  Jonas  Boner  

    •  Named  aVer  Swedish  mountain   •  Adopted  by  MarAn  Odersky  &  Typesafe   •  First  release  July  2009   •  Latest  release  January  2015  
  5. Intro  to  Akka   •  What?   “Toolkit  and  run.me

     for  building     highly  concurrent,   distributed,  and  resilient   message-­‐driven  applica.ons   on  the  JVM.”  
  6. 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  
  7. Intro  to  Akka   ReacAve  Manifesto   Responsive   Resilient

      ElasAc   Message   Driven   reacAvemanifesto.org  
  8. Intro  to  Akka   Scale  up  and  out   Burj

     Khalifa,  Dubai   New  Century  Global  Centre,  Chengdu,  China  
  9. 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  
  10. Intro  to  Akka   •  The  Actor  Model   State

      Behaviour   Actor   Mailbox   Akka runtime enforces that an Actor only processes one message at a time
  11. Work  Pulling  Pa-ern   •  Modern  management  style   • 

    Laissez-­‐faire  (lit.  “Leave  do”)   •  Empowering   •  LiberaAng