Let's Take a Look at Akka-Java

  • Published on
    14-Jul-2015

  • View
    379

  • Download
    2

Embed Size (px)

Transcript

  • scale-up

    response time: s -> ms high availability: 3 nines (8h) -> 5+ nines (5- min) storage: GBs (109) -> PBs (1015) hardware: from mobile phone to 1000+ nodes cluster

  • Reactive Software DesignReactive Manifesto v2.0 (Sept, 2014)

    http://www.reactivemanifesto.org/

  • Reactive Software DesignReactive Manifesto v2.0 (Sept, 2014)

    http://www.reactivemanifesto.org/

  • GENE AMDAHL, 1967

  • Reactive Software DesignReactive Manifesto v2.0 (Sept, 2014)

    http://www.reactivemanifesto.org/

  • Reactive Software DesignReactive Manifesto v2.0 (Sept, 2014)

    http://www.reactivemanifesto.org/

  • Reactive Software DesignReactive Manifesto v2.0 (Sept, 2014)

    http://www.reactivemanifesto.org/

  • Actor-modelCARL HEWITT, 1973

    : : Erlang - HA=9 nines

    Akka 2006 2009 (Scala + Java) 2013 Scala Standard

    Library 2014 Java8 (2.3.0;

    akka.japi.pf) to be continued

  • Actor?Event-driven ,

    single-thread

    Actor?

    No shared mutable state

  • : purely-immutable : serializable : Actor-

    Serializable etc.

    vs.

    n immutable , toString,

    equals, hashCode ready!

  • RandomGeneratorActor in Java7

    Process message somehow here

    Its unfortunate

    @venkat_s

  • Java 8 Key Features Streams Lambdas Parallel Operations

    No PermGen New Date & Time API Concurrent Accumulators Nashorn (HH : Java JavaScript) Base64

  • RandomGeneratorActor in Java8

    PartialFunction

    vs.

    Pattern matching

  • - : Java

    An actor without ActorRef

  • - : Scala

  • Main Application: Java vs. Scala

  • GameActor in Java8

    Predicate

  • spin()

  • GameActor Scala

  • Actor Tree

  • Supervision Modelsomewhere in UserActor

  • Routing RoundRobin Random SmallestMailbox Broadcast ScatterGatherFirstCompleted (Custom)

  • Remote actors

  • Akka Environment TestKit Akka Cluster Akka IO Software Transactional Memory (Akka STM) Finite State Machines (Akka FSM) Durable Mailboxes & other persistence models Pub/Sub

    Akka Spring (actors as prototype-scoped beans) Akka Apache Camel (messages endpoint)

  • !

    ?