Building Reactive Apps

1,279 views

Published on

Published in: Technology, Education

Building Reactive Apps

  1. 1. Building Reactive Applications James Ward www.jamesward.com @_JamesWard © 2013 Typesafe Inc. | All rights reserved | 1
  2. 2. Agenda •Intro to Reactive •The Typesafe Platform –Typesafe Activator –Play Framework –Akka –Scala –Tools •Questions © 2013 Typesafe Inc. | All rights reserved | 2
  3. 3. Software is becoming Reactive © 2013 Typesafe Inc. | All rights reserved | 3
  4. 4. Tenets of Reactive Software © 2013 Typesafe Inc. | All rights reserved | 4
  5. 5. ReactiveManifesto.org © 2013 Typesafe Inc. | All rights reserved | 5
  6. 6. The Typesafe Reactive Platform © 2013 Typesafe Inc. | All rights reserved | 6
  7. 7. Productivity Performance © 2013 Typesafe Inc. | All rights reserved | 7
  8. 8. Go Reactive with Typesafe Activator © 2013 Typesafe Inc. | All rights reserved | 9
  9. 9. © 2013 Typesafe Inc. | All rights reserved | 10
  10. 10. Play Framework The High Velocity Web Framework For Java and Scala © 2013 Typesafe Inc. | All rights reserved | 12
  11. 11. © 2013 Typesafe Inc. | All rights reserved | 13
  12. 12. © 2013 Typesafe Inc. | All rights reserved | 14
  13. 13. © 2013 Typesafe Inc. | All rights reserved | 15
  14. 14. Akka © 2013 Typesafe Inc. | All rights reserved | 17
  15. 15. © 2013 Typesafe Inc. | All rights reserved | 18
  16. 16. Actors •Event-driven •Managed concurrency •Resilience & supervision •Scales up & out •Non-request based lifecycle © 2013 Typesafe Inc. | All rights reserved | 19
  17. 17. Scala © 2013 Typesafe Inc. | All rights reserved | 21
  18. 18. © 2013 Typesafe Inc. | All rights reserved | 22
  19. 19. Go Reactive! © 2013 Typesafe Inc. | All rights reserved | 23
  20. 20. 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 | 24
  21. 21. Actors •event-driven •managed concurrency •resilience & supervision •non-request based lifecycle © 2013 Typesafe Inc. | All rights reserved | 25
  22. 22. Request/Response: Traditional vs. Reactive def getTweets = Action { Ok(WS.get("http://twitter.com/")) } Client blocking Server blocking Service nonblocking Service def getTweets = Action { Async { Ok(WS.get("http://twitter.com/")) }} Client nonblocking Server © 2013 Typesafe Inc. | All rights reserved | 26
  23. 23. Streaming: Traditional vs. Reactive // comet style polling def getNewTweets = Action { Ok(queuedEvents) } Client blocking Server blocking Service Server nonblocking Service def streamTweets = Action { Ok.stream(eventProducer) } Client nonblocking © 2013 Typesafe Inc. | All rights reserved | 28
  24. 24. 2-way Reactive Producer Consumer non-blocking Consumer Producer non-blocking © 2013 Typesafe Inc. | All rights reserved | 29
  25. 25. Tools © 2013 Typesafe Inc. | All rights reserved | 31
  26. 26. Tooling © 2013 Typesafe Inc. | All rights reserved | 32
  27. 27. Testing •JUnit •ScalaTest •Specs2 •Gatling © 2013 Typesafe Inc. | All rights reserved | 33
  28. 28. Build Infrastructure •sbt, Maven, Gradle •Jenkins, Bamboo •TDD, CI, CD © 2013 Typesafe Inc. | All rights reserved | 34
  29. 29. Deployment •Containerless •Play –Stateless •Canary Deployments •Rolling Upgrades •Schema Evolutions •Akka –Clustering in 2.2 with Segmented Upgrades © 2013 Typesafe Inc. | All rights reserved | 35
  30. 30. Monitoring •Typesafe Console •New Relic •Takipi •AppDynamics © 2013 Typesafe Inc. | All rights reserved | 36
  31. 31. Reactive Scales © 2013 Typesafe Inc. | All rights reserved | 37
  32. 32. © 2013 Typesafe Inc. | All rights reserved | 38
  33. 33. Go Reactive! © 2013 Typesafe Inc. | All rights reserved | 39

×