building massively scalable applications with akka - vikas hazrati

Upload: indicthreads

Post on 06-Apr-2018

236 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    1/31

    1

    Building Massively ScalableApplications with Akka

    Vikas Hazrati

    Inphina Technologies

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    2/31

    2

    what?

    Platform for next generation, event driven, scalable and fault tolerant architectures on the

    JVM.

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    3/31

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    4/31

    4

    issues

    concurrency

    scalability

    fault tolerance

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    5/31

    5

    why akka

    simpler concurrency

    event driven

    scale up or scale out

    fault tolerance

    remoting

    scala and java api

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    6/31

    6

    aha actors!message-Passing Concurrency

    share NOTHING

    isolated lightweight processes

    communicates through messages

    asynchronous and non-blocking

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    7/31

    7

    actors

    defined in the 1973 paper by Carl Hewitt

    popularized by Erlang

    alleviates the devfrom explicit locking

    and thread management

    easy to write concurrent and parallel systems

    actors like objects BUT dont share state

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    8/31

    8

    actor models

    Thread-basedEvent-based

    Very lightweight

    can easily create millions on a singleworkstation

    (6.5 million on 4 G RAM )

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    9/31

    9

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    10/31

    10

    defining an actor

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    11/31

    11

    firing messages

    bang bang bang

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    12/31

    12

    send anything

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    13/31

    13

    fault tolerance

    let it crashlinked set of actors

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    14/31

    14

    all for one

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    15/31

    15

    one for one

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    16/31

    16

    supervisor hierarchies

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    17/31

    17

    fault management

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    18/31

    18

    other concepts

    Remote Actors

    Akka STM

    Akka Serialization

    Persistence

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    19/31

    19

    problem statement

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    20/31

    20

    considerations

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    21/31

    21

    hmm...

    STM X

    Serialization X

    Persistence X

    Remoting ?/X

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    22/31

    22

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    23/31

    23

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    24/31

    24

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    25/31

    25

    issues

    maxing out on the os threads

    d h

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    26/31

    26

    dispatchers

    thread based dedicated os threadbound

    event based backed by pool of threads

    priority event based

    work stealing

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    27/31

    27

    l '

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    28/31

    28

    ala carte'

    d i

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    29/31

    29

    used in ...

    i f ti

  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    30/31

    30

    more information

    http://akka.io/docs/akka/1.3-RC1/intro

    http://thoughts.inphina.com/tag/akka/

    http://akka.io/docs/akka/1.3-RC1/introhttp://thoughts.inphina.com/tag/akka/http://thoughts.inphina.com/tag/akka/http://akka.io/docs/akka/1.3-RC1/intro
  • 8/3/2019 Building Massively Scalable Applications With Akka - Vikas Hazrati

    31/31

    31

    Everyone ! Thanks

    [email protected]@vhazrati

    mailto:[email protected]:[email protected]