Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Going Reactive: Building Better Microservices; rob harrop

1,278 views

Published on

SpringOne Platform 2016
Speaker: Rob Harrop; CTO, Skipjaq

Reactive provides developers with an elegant model for constructing applications out of communicating components that improves code readability, eases concurrent programming and supports fine-grained unit testing.

In this talk, we'll see how this model is a natural fit for building resilient microservices. Specifically, we'll see how to:

-Abstract the outside world behind Reactive interfaces
-Split a microserivce into Reactive subsystems
-Ease unit testing with Reactive components
-Introduce concurrency to improve service performance
-Use back-pressure to manage service load and increase resilience

Attendees should be familiar with basic Reactive concepts such as publishers and subscriber but need not have any real-world experience building Reactive systems.

Published in: Technology
  • Be the first to comment

Going Reactive: Building Better Microservices; rob harrop

  1. 1. Going Reactive Rob Harrop
  2. 2. Who am I? ▸ CEO @ Skipjaq ▸ ML-driven performance optimisation ▸ Co-founder of SpringSource ▸ Once upon a time I… ▸ Contributed to Spring Framework ▸ Wrote a book about Spring ▸ Talked a lot about Spring
  3. 3. Who am I? ▸ I’m on Twitter: ▸ @robertharrop ▸ I’m on Github/Gitlab: ▸ github.com/robharrop ▸ gitlab.com/rdh ▸ gitlab.com/skipjaq/hotspotmon ▸ I write about maths, modelling and performance ▸ https://robharrop.github.io If you have questions after the session, {grab, tweet} me.
  4. 4. Agenda
  5. 5. Principles & Practice
  6. 6. Why Reactive?
  7. 7. Architecture is Fractal
  8. 8. Reactive Systems
  9. 9. ELKInflux Graphite Publishers Publish Publishers JVM JVM JVM Systems as Streams Hotspot MonSubscriber Publisher Subscribe
  10. 10. Reactive Subsystems
  11. 11. JVM JVM Subsystems as Streams JVM Stat Sampler Clock Repository WebInflux InfluxDB Browser JVM
  12. 12. Reactive Objects
  13. 13. JVM Total compiles OSR compiles 100 83 62 12 8 5 Subscriber Subscriber Metrics as Streams
  14. 14. JVM as Streams Host JVM 1359 JVM 459 JVM 1976
  15. 15. Principles
  16. 16. Reactive Manifesto ▸ Resilient ▸ Responsive ▸ Elastic ▸ Message-driven
  17. 17. Resilient
  18. 18. Back Pressure Total Compiles Influx Publisher Influx HTTP Client q n ∞ m When n>m we have back pressure - an upstream publisher is too quick for a downstream publisher
  19. 19. Responsive
  20. 20. Asynchrony Publisher Subscriber Q U E U E 1 2 3 1 2
  21. 21. Message-driven
  22. 22. Reactive Streams
  23. 23. public interface Publisher<T> { public void subscribe(Subscriber<? super T> s); }
  24. 24. public interface Subscriber<T> { public void onSubscribe(Subscription s); public void onNext(T t); public void onError(Throwable t); public void onComplete(); }
  25. 25. public interface Subscription { public void request(long n); public void cancel(); }
  26. 26. public interface Processor<T, R> extends Subscriber<T>, Publisher<R> { }
  27. 27. Project Reactor ▸ Reactive Streams defines a programming model ▸ Project Reactor provides an implementation of that model ▸ Flux<T> is a zero-to-many Publisher ▸ Mono<T> is a zero-or-one Publisher ▸ Reactor manages back pressure and asynch processing
  28. 28. Practice
  29. 29. Hotspotmon
  30. 30. Summary ▸ Reactive is a fractal model ▸ Publishers capture outputs from systems ▸ Subscribers capture interaction with those outputs ▸ Async, isolation and capacity management are built-in ▸ Reactive Streams captures the core contracts of a Reactive system ▸ Project Reactor provides a sophisticated implementation of Reactive Streams
  31. 31. Q&A

×