building reactive apps

Post on 10-May-2015

880 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

© 2013 Typesafe Inc. | All rights reserved | 1

Building Reactive Applications

James Wardwww.jamesward.com@_JamesWard

© 2013 Typesafe Inc. | All rights reserved | 2

Agenda

• Intro to Reactive• The Typesafe Platform– Typesafe Activator– Play Framework– Akka– Scala– Tools• Questions

© 2013 Typesafe Inc. | All rights reserved | 3

Software is becoming Reactive

© 2013 Typesafe Inc. | All rights reserved | 4

Tenets of Reactive Software

© 2013 Typesafe Inc. | All rights reserved | 5

ReactiveManifesto.org

© 2013 Typesafe Inc. | All rights reserved | 6

The Typesafe Reactive Platform

© 2013 Typesafe Inc. | All rights reserved | 7

Prod

uctiv

ity

Performance

© 2013 Typesafe Inc. | All rights reserved | 9

Go Reactive with Typesafe Activator

© 2013 Typesafe Inc. | All rights reserved | 10

© 2013 Typesafe Inc. | All rights reserved | 12

Play FrameworkThe High Velocity Web Framework For Java and Scala

© 2013 Typesafe Inc. | All rights reserved | 13

© 2013 Typesafe Inc. | All rights reserved | 14

© 2013 Typesafe Inc. | All rights reserved | 15

© 2013 Typesafe Inc. | All rights reserved | 17

Akka

© 2013 Typesafe Inc. | All rights reserved | 18

© 2013 Typesafe Inc. | All rights reserved | 19

Actors

• Event-driven• Managed concurrency• Resilience & supervision• Scales up & out• Non-request based lifecycle

© 2013 Typesafe Inc. | All rights reserved | 21

Scala

© 2013 Typesafe Inc. | All rights reserved | 22

© 2013 Typesafe Inc. | All rights reserved | 23

Go Reactive!

© 2013 Typesafe Inc. | All rights reserved | 24

Reactive Web / Mobile Apps

• Reactive Request– Async & Non-Blocking Request & Response• Reactive Composition– Reactive Request + Reactive Request + ...• Reactive Push– Stream Producer• 2-way Reactive = Bi-Directional Reactive Push• Reactive UIs– Interactive, Data Synchronization, Real-time Collaboration

© 2013 Typesafe Inc. | All rights reserved | 25

Actors

• event-driven• managed concurrency• resilience & supervision• non-request based lifecycle

© 2013 Typesafe Inc. | All rights reserved | 26

Request/Response: Traditional vs. Reactive

def getTweets = Action { Ok(WS.get("http://twitter.com/"))}

Client Server Serviceblocking blocking

def getTweets = Action { Async { Ok(WS.get("http://twitter.com/"))}}

Client Server Servicenon-blocking

non-blocking

© 2013 Typesafe Inc. | All rights reserved | 28

Streaming: Traditional vs. Reactive

// comet style pollingdef getNewTweets = Action { Ok(queuedEvents)}

Client Server Serviceblocking blocking

def streamTweets = Action { Ok.stream(eventProducer)}

Client Server Servicenon-blocking

non-blocking

© 2013 Typesafe Inc. | All rights reserved | 29

2-way Reactive

ProducerConsumer

ConsumerProducer

non-blocking

non-blocking

© 2013 Typesafe Inc. | All rights reserved | 31

Tools

© 2013 Typesafe Inc. | All rights reserved | 32

Tooling

© 2013 Typesafe Inc. | All rights reserved | 33

Testing

• JUnit• ScalaTest• Specs2•Gatling

© 2013 Typesafe Inc. | All rights reserved | 34

Build Infrastructure

• sbt, Maven, Gradle• Jenkins, Bamboo• TDD, CI, CD

© 2013 Typesafe Inc. | All rights reserved | 35

Deployment

• Containerless• Play–Stateless• Canary Deployments• Rolling Upgrades• Schema Evolutions

• Akka–Clustering in 2.2 with Segmented Upgrades

© 2013 Typesafe Inc. | All rights reserved | 36

Monitoring

• Typesafe Console• New Relic• Takipi• AppDynamics

© 2013 Typesafe Inc. | All rights reserved | 37

Reactive Scales

© 2013 Typesafe Inc. | All rights reserved | 38

© 2013 Typesafe Inc. | All rights reserved | 39

Go Reactive!

top related