get reactive microservices programming and systems
play

Get Reactive: Microservices, Programming, and Systems Jeremy Davis - PowerPoint PPT Presentation

Get Reactive: Microservices, Programming, and Systems Jeremy Davis Principal Solution Architect, App Dev @argntprgrmr Why Does Any of This Matter? Jakob Nielsen 46 years, 3 numbers 0.1 1 10 3 microservicesjourney.com 4


  1. Get Reactive: Microservices, Programming, and Systems Jeremy Davis 
 Principal Solution Architect, App Dev 
 @argntprgrmr

  2. Why Does Any of This Matter?

  3. Jakob Nielsen 46 years, 3 numbers 0.1 1 10 3 microservicesjourney.com

  4. 4 microservicesjourney.com

  5. Reactive is Responsive

  6. Also Tools! there are always tools 6

  7. Reactive Systems/Reactive Programming

  8. Programming, Systems, Both Observable.range(1, 100) .groupBy(n -> n % 2 == 0) .flatMap(g -> { return g.takeWhile(i -> i < 30).toList(); }).filter(l -> !l.isEmpty()).forEach(System.out::println); 8

  9. 9 microservicesjourney.com

  10. Reactive Programming Reactive Systems Event Driven Message Driven Embraces realities of data Embraces realities of the network 10 imicroservicesjourney.com

  11. Reactive Systems

  12. Reactive Manifesto 12

  13. Responsive because people get bored dependability • maintained under failure (resilience) • maintained under load (elasticity) • 13

  14. Resilient things fail The system must be responsive in the face of failure must be designed for not added in • self-healing, full recovery • replication • isolation and containment • delegation • 14 microservicesjourney.com

  15. Elastic everything changes A System must stay responsive under various workloads scales up and down • no contention points or bottlenecks • replicable/shardable components • provide relevant live performance measures • 15

  16. Message Driven asynchronous communication asynchronous, non-blocking • location transparency • failures delegated as messages • back pressure • 16

  17. Reactive Microservices

  18. Why? the basics “The microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API . These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies. “ — Martin Fowler http://martinfowler.com/articles/microservices.html 18

  19. Toolkits, Libraries, Frameworks

  20. 20 microservicesjourney.com

  21. Reactive Programming

  22. ReactiveX An API for asynchronous programming with observable streams 22 INSERT DESIGNATOR, IF NEEDED (EDIT ON MASTER SLIDE)

  23. RxJava as opposed to traditional programming Traditional RxJava • Call a method • Create a method that does something useful • Store the return value in a variable with the return values of an asynchronous call • Do something useful with the variable • Define the asynchronous call ( Observable ) • Attach an observer to the Observable by subscribing • Do other stuff until the call returns and the Observable begins to operate on the results 23 INSERT DESIGNATOR, IF NEEDED (EDIT ON MASTER SLIDE)

  24. rx.Observable() Observable.range(1, 100) .groupBy(n -> n % 2 == 0) .flatMap(g -> { return g.toList(); }).forEach(System.out::println); 24

  25. Observer Pattern like the Gang of Four pattern with onCompleted() and onError() 25 microservicesjourney.com

  26. rx.Observable() 26

  27. Operators (marbles) Insert copy 27 INSERT DESIGNATOR, IF NEEDED (EDIT ON MASTER SLIDE)

  28. 28

  29. Summary: rxJava all about the Observables Observable • Operators • Marbles • Learning curve • 29

  30. One Rule: “Don’t mutate state outside of the function”

  31. Reactive Streams

  32. Reactive Streams a standard for asynchronous stream processing that isn’t for end users • Standard • Interoperability layer • no operators • java.util.concurrent.Flow • Github • JavaScript • Lightbend, Netflix, Pivotal, Red Hat 32 INSERT DESIGNATOR, IF NEEDED (EDIT ON MASTER SLIDE)

  33. Actor Mailbox Actor Actor Mailbox Mailbox Actor Actor Mailbox Mailbox 33 INSERT DESIGNATOR, IF NEEDED (EDIT ON MASTER SLIDE)

  34. Actor Mailbox akka://default/user/$a#114635109 Actor Mailbox akka://default/user/$a#114635173 34 INSERT DESIGNATOR, IF NEEDED (EDIT ON MASTER SLIDE)

  35. 35 INSERT DESIGNATOR, IF NEEDED (EDIT ON MASTER SLIDE)

  36. Summary: akka its all about the actor model Actor Model • Messaging • Addressing • Steams, Web, others • Reactive end to end • 36

  37. a toolkit for building reactive applications on the JVM COLUMN HEADING ALL CAPS Event Loop Vertices Event Bus 37 INSERT DESIGNATOR, IF NEEDED (EDIT ON MASTER SLIDE)

  38. single threaded event loop 38

  39. Cardinal Rule: “Don’t Block the Event Loop”

  40. its all about verticles 40

  41. messages 41

  42. JsonObject 42

  43. Summary: Eclipse Vert.x its all about reactive Reactive from end to end • Json • Event Loop • Messaging • rxJava built in • Polyglot • 43

  44. Project Reactor and WebFlux 44

  45. 45

  46. Summary: Spring Reactor its hidden Flux • Mono • WebFlux • Reactive Streams • 46

  47. Links General Books: https://info.lightbend.com/COLL-20XX-Designing-Reactive-Systems_RES-LP.html Webinars : https://www.lightbend.com/blog/akka-revealed-jvm-architects-journey-from-resilient-actors- to-scalable-clusters https://www.lightbend.com/blog/using-the-actor-model-with-domain-driven-design-ddd-in- reactive-systems-with-vaughn-vernon Blogs: https://developer.lightbend.com/blog/2017-08-10-atotm-akka-messaging-part-1/index.html https://developer.lightbend.com/blog/2017-11-01-atotm-akka-messaging-part-2/index.html 47

  48. Links Vert.x Tutorials: http://vertx.io/blog/posts/introduction-to-vertx.html http://escoffier.me/vertx-hol/ Books: http://vertx.io/docs/guide-for-java-devs/ https://developers.redhat.com/promotions/building-reactive-microservices-in-java/ Presentations: https://www.youtube.com/channel/UCGN6L3tRhs92Uer3c6VxOSA 48

  49. Links RxJava Books: http://shop.oreilly.com/product/0636920042228.do Code: https://github.com/ReactiveX/RxJava https://github.com/jhusain/learnrxjava Presentations: GOTO 2013 • Functional Reactive Programming with RxJava • Ben Christensen 49

  50. Links Spring Reactor/WebFlux Blogs: https://spring.io/blog/2016/06/07/notes-on-reactive-programming-part-i-the-reactive- landscape Presentations: https://www.youtube.com/watch?v=zVNIZXf4BG8 50

  51. Thank You! plus.google.com/+RedHat facebook.com/redhatinc linkedin.com/company/red-hat twitter.com/RedHatNews youtube.com/user/RedHatVideos

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend