SlideShare a Scribd company logo
1 of 110
THIRDCHANNEL @svpember
Reactive Options for Groovy
Steve Pember
CTO, ThirdChannel
@svpember
SpringOne 2GX, 2015
What is ‘Reactive’?
THIRDCHANNEL @svpember
Possible Reactive Definitions
• Reactive Programming
Imperative: A = B+C at that moment in time
Reactive: A = B+C whenever B or C change
values
THIRDCHANNEL @svpember
THIRDCHANNEL @svpember
Possible Reactive Definitions
• Reactive Programming
• Reactive Systems
THIRDCHANNEL @svpember
Possible Reactive Definitions
• Reactive Programming
• Reactive Systems
• Reactive Streams / Reactive Extensions (Rx)
THIRDCHANNEL @svpember
Possible Reactive Definitions
• Reactive Programming
• Reactive Systems
• Reactive Streams / Reactive Extensions (Rx)
THIRDCHANNEL @svpember
Agenda
• Reactive Systems
• Reactive Streams / Reactive Extensions
• Reactive Groovy
The Need For Reactive
(The Reactive Manifesto)
–Johnny Appleseed
“Type a quote here.”
–Johnny Appleseed
“Type a quote here.”
http://www.internetlivestats.com/internet-users/
THIRDCHANNEL @svpember
–Johnny Appleseed
“Type a quote here.”
–Johnny Appleseed
“Type a quote here.”
https://medium.com/reactive-programming/what-is-reactive-programming-bc9fa7f4a7fc
Need to Handle As Many Users As
Possible
THIRDCHANNEL @svpember
Reactive Systems
• The Need for Reactive
• 4 Reactive Principles
THIRDCHANNEL @svpember
THIRDCHANNEL @svpember
Reactive Systems
• The Need for Reactive
• 4 Reactive Principles
• Responsive
THIRDCHANNEL @svpember
THIRDCHANNEL @svpember
Reactive Systems
• The Need for Reactive
• 4 Reactive Principles
• Responsive
• Resilient
–Johnny Appleseed
“Type a quote here.”
Embrace Failure
Independent Things Fail
Independently
THIRDCHANNEL @svpember
Reactive Systems
• The Need for Reactive
• 4 Reactive Principles
• Responsive
• Resilient
• Elastic (Scalable)
THIRDCHANNEL @svpember
Reactive Systems
• The Need for Reactive
• 4 Reactive Principles
• Responsive
• Resilient
• Elastic (Scalable)
• Asynchronous / Message-Driven
Humans Are Terrible At Concurrency
The Manifesto is not Concrete
Recommended: Actors
THIRDCHANNEL @svpember
Akka
THIRDCHANNEL @svpember
THIRDCHANNEL @svpember
THIRDCHANNEL @svpember
–Johnny Appleseed
“Type a quote here.”
–Johnny Appleseed
“Type a quote here.”
Anyway.
THIRDCHANNEL @svpember
Hooray for Microservices
THIRDCHANNEL @svpember
Agenda
• Reactive Systems
• Reactive Streams / Reactive Extensions
–Me (now)
“A standard for asynchronous stream processing
of potentially infinite data, across boundaries, with
non-blocking backpressure”
VS
–Jafar Husain
https://www.youtube.com/watch?v=XRYN2xt11Ek
“Collection + time”
–Johnny Appleseed
“Type a quote here.”
THIRDCHANNEL @svpember
THIRDCHANNEL @svpember
Story Time
THIRDCHANNEL @svpember
Story Time
THIRDCHANNEL @svpember
Story Time
THIRDCHANNEL @svpember
Story Time
2012 - MS Open Source’s RX! (wut?)
THIRDCHANNEL @svpember
Story Time
2012 - MS Open Source’s RX! (wut?)
–Johnny Appleseed
“Type a quote here.”
THIRDCHANNEL @svpember
Rx: More Than a Stream
• Collections + Time
THIRDCHANNEL @svpember
Rx: More Than a Stream
• Collections + Time
• Pull vs Push
THIRDCHANNEL @svpember
THIRDCHANNEL @svpember
Rx: More Than a Stream
• Collections + Time
• Pull vs Push
• Observable / Subscriber
An Observable is a push-based collection
THIRDCHANNEL @svpember
Rx: More Than a Stream
• Collections + Time
• Pull vs Push
• Observable / Subscriber
• Hot / Cold
THIRDCHANNEL @svpember
THIRDCHANNEL @svpember
Rx: More Than a Stream
• Collections + Time
• Pull vs Push
• Observable / Subscriber
• Hot / Cold
• Composable
THIRDCHANNEL @svpember
Rx: More Than a Stream
• Collections + Time
• Pull vs Push
• Observable / Subscriber
• Hot / Cold
• Composable
• Async is Easy!
The Subscriber & Observable can
be independently Async
THIRDCHANNEL @svpember
THIRDCHANNEL @svpember
Rx: More Than a Stream
• Collections + Time
• Pull vs Push
• Observable / Subscriber
• Hot / Cold
• Composable
• Async is Easy!
• Backpressure
THIRDCHANNEL @svpember
THIRDCHANNEL @svpember
Rx: More Than a Stream
• Collections + Time
• Pull vs Push
• Observable / Subscriber
• Hot / Cold
• Composable
• Async is Easy!
• Backpressure
• Observable Interaction
Don’t Unsubscribe from Events / Observables.
Programatically complete them when some
other event or Observable fires.
THIRDCHANNEL @svpember
Agenda
• Reactive Systems
• Reactive Streams / Reactive Extensions
• Groovy Options
THIRDCHANNEL @svpember
A Few Groovy Options…
• Akka
THIRDCHANNEL @svpember
A Few Groovy Options…
• Akka
• Akka Streams
THIRDCHANNEL @svpember
Akka & Akka Streams
• Library
• Definition of Reactive System
• Typesafe
• Actor-Based Concurrency
• Implemented Streams on Top of Actor Model
THIRDCHANNEL @svpember
A Few Groovy Options…
• Akka
• Akka Streams
• RxJava / RxGroovy
THIRDCHANNEL @svpember
RxJava
• Library
• Comes out of Netflix
• Part of reactivex.io
• Reactive Streams on the JVM
THIRDCHANNEL @svpember
THIRDCHANNEL @svpember
A Few Groovy Options…
• Akka
• Akka Streams
• RxJava / RxGroovy
• Ratpack
THIRDCHANNEL @svpember
• HTTP application server
• Non-opinionated
• Built on Reactive Streams, Netty, Java 8, Guava
• Fully embodies reactive
THIRDCHANNEL @svpember
THIRDCHANNEL @svpember
THIRDCHANNEL @svpember
A Few Groovy Options…
• Akka
• Akka Streams
• RxJava / RxGroovy
• Ratpack
• Reactor
THIRDCHANNEL @svpember
• Library
• Reactive Streams
• Reactor Pattern
• Built on LMAX Ring Buffer / Disrupter
THIRDCHANNEL @svpember
VS
THIRDCHANNEL @svpember
THIRDCHANNEL @svpember
THIRDCHANNEL @svpember
THIRDCHANNEL @svpember
• Groovy Parallelism and Concurrency
• Built into the language!
• Actors
• DataFlow
• Async Closures
THIRDCHANNEL @svpember
Getting Started
Demo Time
That’s Great, But How do I get started?
THIRDCHANNEL @svpember
Advice for exploring RX
• Start thinking in terms of streams / pipelines
• Drop in one of the libraries into your project
• Observe a finite data set (Observe.from())
• You only need 4 functions
• Be Aware of Subscribe / Observe On
• Create your own Observables
• Connect your Observables
Final Thought: What About Java 8
Streams?
THIRDCHANNEL @svpember
Java 8 Streams
• Built into the language
• Meant for ‘pull’ on finite Iterables
• Parallelization has rather severe problems (e.g. https://dzone.com/articles/think-
twice-using-java-8)
• No Async
• vs Observables -> potentially infinite items, async, with back pressure
Actual Final Thought:
Embrace Reactive!
Thank You!
@svpember
Questions?
Image Credits
• 1000ms Time To glass:
https://docs.google.com/presentation/d/1IRHyU7_crIiCjl0Gvue0WY3eY_eYvFQvSfwQouW9368/present?slide=id.g1e697bbb_0_7
• internet users in the world: http://www.internetlivestats.com/internet-users/
• internet users vs Facebook: https://medium.com/reactive-programming/what-is-reactive-programming-bc9fa7f4a7fc
• reactivex logo: https://www.stickermule.com/marketplace/2223-rx-reactive-extensions-logo-4
• cheetah: www.livescience.com/21944-usain-bolt-vs-cheetah-animal-olympics.html
• dominoes: https://www.flickr.com/photos/louish/5611657857/sizes/l/in/photostream/
• 300 / Spartans: http://www.300themovie.com/
• latop punch: http://walls4joy.com/wallpaper/730566-angry-laptops-punch
• mailman: http://thebrandtstandard.com/2013/02/09/u-s-post-office-to-end-saturday-letter-delivery-this-summer/
• Actors diagram: https://blog.codecentric.de/en/2015/08/introduction-to-akka-actors/
• actor system: http://letitcrash.com/post/30585282971/discovering-message-flows-in-actor-systems-with
• slow down: http://forthefamily.org/reminder-slow/
• Buffalo: http://news.sd.gov/newsitem.aspx?id=15164
• Midvale School for the Gifted: http://www.2ndfirstlook.com/2012/09/gary-larson.html
• Blueprints: https://en.wikipedia.org/wiki/File:House_Plans_(Blueprints).pdf
More On Reactive:
• Jafar Husain: RxJS: https://www.youtube.com/watch?v=XRYN2xt11Ek
• Reactive Streams Spec: http://www.reactive-streams.org/
• Reactive Manifesto: http://www.reactivemanifesto.org/
• Akka: http://akka.io/
• rxJava / ReactiveX libraries: https://github.com/ReactiveX
• Ratpack: http://ratpack.io/
• Reactor: https://github.com/reactor/reactor
• The Introduction to Reactive Programming you’ve been missing: https://gist.github.com/staltz/868e7e9bc2a7b8c1f754
• Martin Fowler: Stream / Pipeline programming: http://martinfowler.com/articles/refactoring-pipelines.html

More Related Content

What's hot

Reactive All the Way Down the Stack
Reactive All the Way Down the StackReactive All the Way Down the Stack
Reactive All the Way Down the StackSteve Pember
 
Create and upload your first Perl module to CPAN
Create and upload your first Perl module to CPANCreate and upload your first Perl module to CPAN
Create and upload your first Perl module to CPANbrian d foy
 
Erlang - Dive Right In
Erlang - Dive Right InErlang - Dive Right In
Erlang - Dive Right Invorn
 
Interns What Is DevOps
Interns What Is DevOpsInterns What Is DevOps
Interns What Is DevOpsAaron Blythe
 
Finding CPAN adoption candidates
Finding CPAN adoption candidatesFinding CPAN adoption candidates
Finding CPAN adoption candidatesneilbowers
 
Performance - When, What and How
Performance - When, What and HowPerformance - When, What and How
Performance - When, What and HowAstrails
 
Spring Boot
Spring BootSpring Boot
Spring Bootgedoplan
 
STAQ Development Manual (Redacted)
STAQ Development Manual (Redacted)STAQ Development Manual (Redacted)
STAQ Development Manual (Redacted)Mike Subelsky
 
CPAN Workshop, Chicago 2014
CPAN Workshop, Chicago 2014CPAN Workshop, Chicago 2014
CPAN Workshop, Chicago 2014brian d foy
 
Part of the pipeline-why continuous testing is essential - velocity conf
Part of the pipeline-why continuous testing is essential - velocity confPart of the pipeline-why continuous testing is essential - velocity conf
Part of the pipeline-why continuous testing is essential - velocity confTapabrata Pal
 
TuleapCon2017 -Automating Jenkins build with Tuleap trackers
TuleapCon2017 -Automating Jenkins build with Tuleap trackersTuleapCon2017 -Automating Jenkins build with Tuleap trackers
TuleapCon2017 -Automating Jenkins build with Tuleap trackersTuleap
 
Ruby Concurrency Realities
Ruby Concurrency RealitiesRuby Concurrency Realities
Ruby Concurrency RealitiesMike Subelsky
 
Elm - never get a runtime error anymore. Almost.
Elm - never get a runtime error anymore. Almost.Elm - never get a runtime error anymore. Almost.
Elm - never get a runtime error anymore. Almost.Anton Astashov
 
RxJS - The Basics & The Future
RxJS - The Basics & The FutureRxJS - The Basics & The Future
RxJS - The Basics & The FutureTracy Lee
 
OnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform BuildOnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform BuildDavid Rosen
 
DevOps Pipelines and Metrics Driven Feedback Loops
DevOps Pipelines and Metrics Driven Feedback LoopsDevOps Pipelines and Metrics Driven Feedback Loops
DevOps Pipelines and Metrics Driven Feedback LoopsAndreas Grabner
 

What's hot (20)

Reactive All the Way Down the Stack
Reactive All the Way Down the StackReactive All the Way Down the Stack
Reactive All the Way Down the Stack
 
Rails is Secure
Rails is SecureRails is Secure
Rails is Secure
 
Create and upload your first Perl module to CPAN
Create and upload your first Perl module to CPANCreate and upload your first Perl module to CPAN
Create and upload your first Perl module to CPAN
 
Erlang - Dive Right In
Erlang - Dive Right InErlang - Dive Right In
Erlang - Dive Right In
 
Interns What Is DevOps
Interns What Is DevOpsInterns What Is DevOps
Interns What Is DevOps
 
Finding CPAN adoption candidates
Finding CPAN adoption candidatesFinding CPAN adoption candidates
Finding CPAN adoption candidates
 
Performance - When, What and How
Performance - When, What and HowPerformance - When, What and How
Performance - When, What and How
 
The tale of 100 cve's
The tale of 100 cve'sThe tale of 100 cve's
The tale of 100 cve's
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
STAQ Development Manual (Redacted)
STAQ Development Manual (Redacted)STAQ Development Manual (Redacted)
STAQ Development Manual (Redacted)
 
CPAN Workshop, Chicago 2014
CPAN Workshop, Chicago 2014CPAN Workshop, Chicago 2014
CPAN Workshop, Chicago 2014
 
Part of the pipeline-why continuous testing is essential - velocity conf
Part of the pipeline-why continuous testing is essential - velocity confPart of the pipeline-why continuous testing is essential - velocity conf
Part of the pipeline-why continuous testing is essential - velocity conf
 
TuleapCon2017 -Automating Jenkins build with Tuleap trackers
TuleapCon2017 -Automating Jenkins build with Tuleap trackersTuleapCon2017 -Automating Jenkins build with Tuleap trackers
TuleapCon2017 -Automating Jenkins build with Tuleap trackers
 
Ruby Concurrency Realities
Ruby Concurrency RealitiesRuby Concurrency Realities
Ruby Concurrency Realities
 
Elm - never get a runtime error anymore. Almost.
Elm - never get a runtime error anymore. Almost.Elm - never get a runtime error anymore. Almost.
Elm - never get a runtime error anymore. Almost.
 
Rails tools
Rails toolsRails tools
Rails tools
 
Flink in action
Flink in actionFlink in action
Flink in action
 
RxJS - The Basics & The Future
RxJS - The Basics & The FutureRxJS - The Basics & The Future
RxJS - The Basics & The Future
 
OnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform BuildOnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform Build
 
DevOps Pipelines and Metrics Driven Feedback Loops
DevOps Pipelines and Metrics Driven Feedback LoopsDevOps Pipelines and Metrics Driven Feedback Loops
DevOps Pipelines and Metrics Driven Feedback Loops
 

Similar to Springone2gx 2015 Reactive Options for Groovy

An Introduction to Reactive Application, Reactive Streams, and options for JVM
An Introduction to Reactive Application, Reactive Streams, and options for JVMAn Introduction to Reactive Application, Reactive Streams, and options for JVM
An Introduction to Reactive Application, Reactive Streams, and options for JVMSteve Pember
 
An introduction to Reactive applications, Reactive Streams, and options for t...
An introduction to Reactive applications, Reactive Streams, and options for t...An introduction to Reactive applications, Reactive Streams, and options for t...
An introduction to Reactive applications, Reactive Streams, and options for t...Steve Pember
 
Reactive Streams and the Wide World of Groovy
Reactive Streams and the Wide World of GroovyReactive Streams and the Wide World of Groovy
Reactive Streams and the Wide World of GroovySteve Pember
 
Which Freaking Database Should I Use?
Which Freaking Database Should I Use?Which Freaking Database Should I Use?
Which Freaking Database Should I Use?Great Wide Open
 
Patterns of the Lambda Architecture -- 2015 April - Hadoop Summit, Europe
Patterns of the Lambda Architecture -- 2015 April - Hadoop Summit, EuropePatterns of the Lambda Architecture -- 2015 April - Hadoop Summit, Europe
Patterns of the Lambda Architecture -- 2015 April - Hadoop Summit, EuropeFlip Kromer
 
A year with event sourcing and CQRS
A year with event sourcing and CQRSA year with event sourcing and CQRS
A year with event sourcing and CQRSSteve Pember
 
RxJS and Reactive Programming - Modern Web UI - May 2015
RxJS and Reactive Programming - Modern Web UI - May 2015RxJS and Reactive Programming - Modern Web UI - May 2015
RxJS and Reactive Programming - Modern Web UI - May 2015Ben Lesh
 
Introduction to Spring Reactor
Introduction to Spring ReactorIntroduction to Spring Reactor
Introduction to Spring ReactorDrSimoneDiCola
 
Patterns of the Lambda Architecture -- 2015 April -- Hadoop Summit, Europe
Patterns of the Lambda Architecture -- 2015 April -- Hadoop Summit, EuropePatterns of the Lambda Architecture -- 2015 April -- Hadoop Summit, Europe
Patterns of the Lambda Architecture -- 2015 April -- Hadoop Summit, EuropeFlip Kromer
 
Akka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldAkka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldKonrad Malawski
 
How Reactive Streams & Akka Streams change the JVM Ecosystem
How Reactive Streams & Akka Streams change the JVM EcosystemHow Reactive Streams & Akka Streams change the JVM Ecosystem
How Reactive Streams & Akka Streams change the JVM EcosystemKonrad Malawski
 
A Helpful Introduction to RxSwift
A Helpful Introduction to RxSwiftA Helpful Introduction to RxSwift
A Helpful Introduction to RxSwiftSergeyShulga8
 
Helpful into to Rx
Helpful into to RxHelpful into to Rx
Helpful into to RxSerg Dort
 
Relay: Seamless Syncing for React (VanJS)
Relay: Seamless Syncing for React (VanJS)Relay: Seamless Syncing for React (VanJS)
Relay: Seamless Syncing for React (VanJS)Brooklyn Zelenka
 
Message:Passing - lpw 2012
Message:Passing - lpw 2012Message:Passing - lpw 2012
Message:Passing - lpw 2012Tomas Doran
 
Generating Sequences with Deep LSTMs & RNNS in julia
Generating Sequences with Deep LSTMs & RNNS in juliaGenerating Sequences with Deep LSTMs & RNNS in julia
Generating Sequences with Deep LSTMs & RNNS in juliaAndre Pemmelaar
 
Build a Startup with Clojure(Script)
Build a Startup with Clojure(Script)Build a Startup with Clojure(Script)
Build a Startup with Clojure(Script)Théophile Villard
 
London devops logging
London devops loggingLondon devops logging
London devops loggingTomas Doran
 
Expected tensor decomposition with stochastic gradient descent
Expected tensor decomposition with stochastic gradient descentExpected tensor decomposition with stochastic gradient descent
Expected tensor decomposition with stochastic gradient descentKohei Hayashi
 

Similar to Springone2gx 2015 Reactive Options for Groovy (20)

An Introduction to Reactive Application, Reactive Streams, and options for JVM
An Introduction to Reactive Application, Reactive Streams, and options for JVMAn Introduction to Reactive Application, Reactive Streams, and options for JVM
An Introduction to Reactive Application, Reactive Streams, and options for JVM
 
An introduction to Reactive applications, Reactive Streams, and options for t...
An introduction to Reactive applications, Reactive Streams, and options for t...An introduction to Reactive applications, Reactive Streams, and options for t...
An introduction to Reactive applications, Reactive Streams, and options for t...
 
Reactive Streams and the Wide World of Groovy
Reactive Streams and the Wide World of GroovyReactive Streams and the Wide World of Groovy
Reactive Streams and the Wide World of Groovy
 
Which Freaking Database Should I Use?
Which Freaking Database Should I Use?Which Freaking Database Should I Use?
Which Freaking Database Should I Use?
 
Patterns of the Lambda Architecture -- 2015 April - Hadoop Summit, Europe
Patterns of the Lambda Architecture -- 2015 April - Hadoop Summit, EuropePatterns of the Lambda Architecture -- 2015 April - Hadoop Summit, Europe
Patterns of the Lambda Architecture -- 2015 April - Hadoop Summit, Europe
 
A year with event sourcing and CQRS
A year with event sourcing and CQRSA year with event sourcing and CQRS
A year with event sourcing and CQRS
 
RxJS and Reactive Programming - Modern Web UI - May 2015
RxJS and Reactive Programming - Modern Web UI - May 2015RxJS and Reactive Programming - Modern Web UI - May 2015
RxJS and Reactive Programming - Modern Web UI - May 2015
 
Introduction to Spring Reactor
Introduction to Spring ReactorIntroduction to Spring Reactor
Introduction to Spring Reactor
 
Patterns of the Lambda Architecture -- 2015 April -- Hadoop Summit, Europe
Patterns of the Lambda Architecture -- 2015 April -- Hadoop Summit, EuropePatterns of the Lambda Architecture -- 2015 April -- Hadoop Summit, Europe
Patterns of the Lambda Architecture -- 2015 April -- Hadoop Summit, Europe
 
Akka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldAkka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming World
 
How Reactive Streams & Akka Streams change the JVM Ecosystem
How Reactive Streams & Akka Streams change the JVM EcosystemHow Reactive Streams & Akka Streams change the JVM Ecosystem
How Reactive Streams & Akka Streams change the JVM Ecosystem
 
A Helpful Introduction to RxSwift
A Helpful Introduction to RxSwiftA Helpful Introduction to RxSwift
A Helpful Introduction to RxSwift
 
Helpful into to Rx
Helpful into to RxHelpful into to Rx
Helpful into to Rx
 
Relay: Seamless Syncing for React (VanJS)
Relay: Seamless Syncing for React (VanJS)Relay: Seamless Syncing for React (VanJS)
Relay: Seamless Syncing for React (VanJS)
 
Message:Passing - lpw 2012
Message:Passing - lpw 2012Message:Passing - lpw 2012
Message:Passing - lpw 2012
 
Akka streams
Akka streamsAkka streams
Akka streams
 
Generating Sequences with Deep LSTMs & RNNS in julia
Generating Sequences with Deep LSTMs & RNNS in juliaGenerating Sequences with Deep LSTMs & RNNS in julia
Generating Sequences with Deep LSTMs & RNNS in julia
 
Build a Startup with Clojure(Script)
Build a Startup with Clojure(Script)Build a Startup with Clojure(Script)
Build a Startup with Clojure(Script)
 
London devops logging
London devops loggingLondon devops logging
London devops logging
 
Expected tensor decomposition with stochastic gradient descent
Expected tensor decomposition with stochastic gradient descentExpected tensor decomposition with stochastic gradient descent
Expected tensor decomposition with stochastic gradient descent
 

More from Steve Pember

Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Steve Pember
 
SACon 2019 - Surviving in a Microservices Environment
SACon 2019 - Surviving in a Microservices EnvironmentSACon 2019 - Surviving in a Microservices Environment
SACon 2019 - Surviving in a Microservices EnvironmentSteve Pember
 
Surviving in a Microservices environment -abridged
Surviving in a Microservices environment -abridgedSurviving in a Microservices environment -abridged
Surviving in a Microservices environment -abridgedSteve Pember
 
Gradle Show and Tell
Gradle Show and TellGradle Show and Tell
Gradle Show and TellSteve Pember
 
Greach 2018: Surviving Microservices
Greach 2018: Surviving MicroservicesGreach 2018: Surviving Microservices
Greach 2018: Surviving MicroservicesSteve Pember
 
Event storage in a distributed system
Event storage in a distributed systemEvent storage in a distributed system
Event storage in a distributed systemSteve Pember
 
Harnessing Spark and Cassandra with Groovy
Harnessing Spark and Cassandra with GroovyHarnessing Spark and Cassandra with Groovy
Harnessing Spark and Cassandra with GroovySteve Pember
 
Surviving in a microservices environment
Surviving in a microservices environmentSurviving in a microservices environment
Surviving in a microservices environmentSteve Pember
 
Surviving in a Microservices Environment
Surviving in a Microservices EnvironmentSurviving in a Microservices Environment
Surviving in a Microservices EnvironmentSteve Pember
 
Richer Data History with Event Sourcing (SpringOne 2GX 2015
Richer Data History with Event Sourcing (SpringOne 2GX 2015Richer Data History with Event Sourcing (SpringOne 2GX 2015
Richer Data History with Event Sourcing (SpringOne 2GX 2015Steve Pember
 
Gr8conf US 2015 - Intro to Event Sourcing with Groovy
Gr8conf US 2015 - Intro to Event Sourcing with GroovyGr8conf US 2015 - Intro to Event Sourcing with Groovy
Gr8conf US 2015 - Intro to Event Sourcing with GroovySteve Pember
 
Advanced Microservices - Greach 2015
Advanced Microservices - Greach 2015Advanced Microservices - Greach 2015
Advanced Microservices - Greach 2015Steve Pember
 
Richer data-history-event-sourcing
Richer data-history-event-sourcingRicher data-history-event-sourcing
Richer data-history-event-sourcingSteve Pember
 
Managing a Microservices Development Team (And advanced Microservice concerns)
Managing a Microservices Development Team (And advanced Microservice concerns)Managing a Microservices Development Team (And advanced Microservice concerns)
Managing a Microservices Development Team (And advanced Microservice concerns)Steve Pember
 
Reactive Microservice Architecture with Groovy and Grails
Reactive Microservice Architecture with Groovy and GrailsReactive Microservice Architecture with Groovy and Grails
Reactive Microservice Architecture with Groovy and GrailsSteve Pember
 
Why Reactive Architecture Will Take Over The World (and why we should be wary...
Why Reactive Architecture Will Take Over The World (and why we should be wary...Why Reactive Architecture Will Take Over The World (and why we should be wary...
Why Reactive Architecture Will Take Over The World (and why we should be wary...Steve Pember
 
Richer Data History in Groovy with Event Sourcing
Richer Data History in Groovy with Event SourcingRicher Data History in Groovy with Event Sourcing
Richer Data History in Groovy with Event SourcingSteve Pember
 
Distributed Reactive Architecture: Extending SOA with Events
Distributed Reactive Architecture: Extending SOA with EventsDistributed Reactive Architecture: Extending SOA with Events
Distributed Reactive Architecture: Extending SOA with EventsSteve Pember
 
Message Oriented Architecture - Gr8conf US 2013
Message Oriented Architecture - Gr8conf US 2013Message Oriented Architecture - Gr8conf US 2013
Message Oriented Architecture - Gr8conf US 2013Steve Pember
 

More from Steve Pember (19)

Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
 
SACon 2019 - Surviving in a Microservices Environment
SACon 2019 - Surviving in a Microservices EnvironmentSACon 2019 - Surviving in a Microservices Environment
SACon 2019 - Surviving in a Microservices Environment
 
Surviving in a Microservices environment -abridged
Surviving in a Microservices environment -abridgedSurviving in a Microservices environment -abridged
Surviving in a Microservices environment -abridged
 
Gradle Show and Tell
Gradle Show and TellGradle Show and Tell
Gradle Show and Tell
 
Greach 2018: Surviving Microservices
Greach 2018: Surviving MicroservicesGreach 2018: Surviving Microservices
Greach 2018: Surviving Microservices
 
Event storage in a distributed system
Event storage in a distributed systemEvent storage in a distributed system
Event storage in a distributed system
 
Harnessing Spark and Cassandra with Groovy
Harnessing Spark and Cassandra with GroovyHarnessing Spark and Cassandra with Groovy
Harnessing Spark and Cassandra with Groovy
 
Surviving in a microservices environment
Surviving in a microservices environmentSurviving in a microservices environment
Surviving in a microservices environment
 
Surviving in a Microservices Environment
Surviving in a Microservices EnvironmentSurviving in a Microservices Environment
Surviving in a Microservices Environment
 
Richer Data History with Event Sourcing (SpringOne 2GX 2015
Richer Data History with Event Sourcing (SpringOne 2GX 2015Richer Data History with Event Sourcing (SpringOne 2GX 2015
Richer Data History with Event Sourcing (SpringOne 2GX 2015
 
Gr8conf US 2015 - Intro to Event Sourcing with Groovy
Gr8conf US 2015 - Intro to Event Sourcing with GroovyGr8conf US 2015 - Intro to Event Sourcing with Groovy
Gr8conf US 2015 - Intro to Event Sourcing with Groovy
 
Advanced Microservices - Greach 2015
Advanced Microservices - Greach 2015Advanced Microservices - Greach 2015
Advanced Microservices - Greach 2015
 
Richer data-history-event-sourcing
Richer data-history-event-sourcingRicher data-history-event-sourcing
Richer data-history-event-sourcing
 
Managing a Microservices Development Team (And advanced Microservice concerns)
Managing a Microservices Development Team (And advanced Microservice concerns)Managing a Microservices Development Team (And advanced Microservice concerns)
Managing a Microservices Development Team (And advanced Microservice concerns)
 
Reactive Microservice Architecture with Groovy and Grails
Reactive Microservice Architecture with Groovy and GrailsReactive Microservice Architecture with Groovy and Grails
Reactive Microservice Architecture with Groovy and Grails
 
Why Reactive Architecture Will Take Over The World (and why we should be wary...
Why Reactive Architecture Will Take Over The World (and why we should be wary...Why Reactive Architecture Will Take Over The World (and why we should be wary...
Why Reactive Architecture Will Take Over The World (and why we should be wary...
 
Richer Data History in Groovy with Event Sourcing
Richer Data History in Groovy with Event SourcingRicher Data History in Groovy with Event Sourcing
Richer Data History in Groovy with Event Sourcing
 
Distributed Reactive Architecture: Extending SOA with Events
Distributed Reactive Architecture: Extending SOA with EventsDistributed Reactive Architecture: Extending SOA with Events
Distributed Reactive Architecture: Extending SOA with Events
 
Message Oriented Architecture - Gr8conf US 2013
Message Oriented Architecture - Gr8conf US 2013Message Oriented Architecture - Gr8conf US 2013
Message Oriented Architecture - Gr8conf US 2013
 

Recently uploaded

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 

Recently uploaded (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

Springone2gx 2015 Reactive Options for Groovy

Editor's Notes

  1. My name is Steve, and I work for a startup in Boston, MA. Welcome to ‘Reactive Options for Groovy’ Let’s talk about asynchronous data. I should start out by saying that I’m by no means an expert here, but rather a big fan of Reactive.
  2. So let’s begin. When we say ‘Reactive’, what exactly do we mean? There’s several definitions all with varying meanings. You may have heard about Reactive Streams, or RX, or reactive applications, etc, etc. To me, when I hear the term ‘reactive’ I think of 3 possible definitions or interpretations:
  3. first, ‘reactive programming’
  4. Reactive Programming is different from Imperative programming. In Imperative… In reactive… We’ve been working with Reactive programming for years now, even if you don’t know it.
  5. especially if you work at all with User Interfaces (e.g. Javascript). UIs are all about reacting to user input. those of us that have been building Interfaces with Javascript have (likely) been building Reactive applications all along… assuming that is, that you’ve been Javascripting correctly.
  6. Furthermore, recently, the JS kids have been flocking towards tools that allow them to build reactive apps and towards reactive functional programming… which is what I really want to talk about today. On the server side, on the JVM, we have the tools - vastly more powerful tools - to bring some of these approaches to the server side
  7. Moving on… As you might guess, my Second definition: Reactive Systems.
  8. Third: Reactive Streams or Reactive Extensions
  9. today is about reactive systems and RX I think these concepts are the most exciting and they’re gathering quite a bit of traction
  10. agenda for today: talk about reactive systems and what makes a system ‘reactive’ Mostly, though, we’ll be talking about Reactive Streams or Reactive Extensions Will also cover a short list of options available to us in the Groovy ecosystem First up, Reactive Systems and why they’re important.
  11. * So first up, Reactive Systems. In this definition, Reactive is a pattern for building applications to handle modern demands, and was popularized by an online document called the ‘Reactive Manifesto’.
  12. The source of reactive systems can be traced to a document known as the reactive manifesto, which has gone through several revisions over the past few years… most recent edition is from this past september * The term was popularized, I believe, by a company currently known as TypeSafe. They maintain the Manifesto. * I think the best way to understand Reactive is to first talk about the problem it aims to solve
  13. Typesafe has recently had a bit of a rocky relationship with us Spring aficionados In May they decided to change their name, and wrote a blog post about it. They were hoping to find a name evocative of what they do, and were hoping to avoid a market different from monolithic Spring. Which, you know, ok. Spring boot is here and we’re making some sweet microservices with it.
  14. That post also pushed a speaker at this conference, phil webb, to push out this tweet. If you see Phil, give him a high five. Also, his follow up tweet is very interesting, and we’ll touch on Reactor later.
  15. <pause> Anyway, Typesafe ( or whatever they want to call themselves now) does have a point. The internet is growing. The number of users on the internet has estimated to grow from 750 million to nearly 3 billion in just 11 years,
  16. Even with this increased demand, users expect their browsing experiences to respond … immediately. And they get angry and impatient when sites are slow
  17. Borrowed this slide from ilya grigorik, who introduced (I think) the idea of the 1000ms time to glass challenge… which basically states that your site should render to the screen (or glass) within 1 second of a user interaction. The reason for this is that studies have been done that show that users’s focus and mental concentration goes away when waiting for more than 1 second. Several years ago, an engineer with Amazon named Greg Linden revealed that the company ran experiment where they intentionally slowed down site performance - 100ms delay resulted in 1 percent drop in sales.
  18. Furthermore, the Scale of the internet is growing tremendously The number of users in 2012 of just one site was equal to the entire internet user base just 6 years before that in 2006. The site is facebook, but still. Just shows you that web sites are facing increasing scaling problems
  19. Applications need to handle as many users as possible… as efficiently as possible to avoid the stampeding herd problem Many frameworks and server technologies still use technology and patterns since the beginning of web development. E.g. a thread based approach, where one request consumes one thread for the duration of the request. This is especially a problem in a distributed system environment, where that request may need to communicate with other systems.
  20. Reactive systems have 4 main principles that are meant to help guide a developer to meet modern system demands.
  21. In it, the Manifesto declares that there are 4 principles that any application must meet in order to fulfill customer demand. Note that being Reactive isn’t a library or a framework, rather it’s a set of design principles that your app should strive to meet.
  22. First: the application must be responsive
  23. This comes right off of a previous point about speed. Your application, in general, should respond to user interaction as quickly as possible. A more ‘responsive’ application is a pleasing experience to your end user. The faster your application responds to their input, the less time they sit staring at your app, and the happier they’ll be. Also, it’s just important to be fast. Several years ago, an engineer with Amazon named Greg Linden revealed that the company ran experiment where they intentionally slowed down site performance 100ms delay resulted in 1 percent drop in sales. In other words, slowing down their site by a tenth of a second resulted in a considerable loss in revenue. Which makes sense, right? The faster you can take customer’s orders, the more money you make
  24. Next up: your app must be resilient
  25. The resilient principle says that we, as software developers, should have the mindset that at any given moment, your code is going to break. Think to yourself: How coupled is my code? -How many of your systems are held together by quick hacks? (I know I’m guilty of this one) - How dependent on other services, domain objects, third party services, etc is my application? - What happens to my system if any one of those go down?
  26. The resilient principle says that we shouldn’t be scared of our application failing… instead we should *embrace* failure
  27. -A Reactive application is resilient to failure. If one component breaks down, the others should not falter. if a third party service is unavailable, your app should have some fallback behavior. -Your system should be able to suffer damage and still operate. -For example, imagine an ecommerce application. if the ability to place orders goes down.. while your team is scrambling to fix, the end user should still be able to browse the products and add items to the cart. -They should just see a message that says “Sorry, order placement will be right back”…
  28. Your resilient mantra should be “Independent things fail independently”
  29. third:
  30. Your application should stay responsive under load it should react to changes in workload by increasing or decreasing resources
  31. lastly, Reactive applications are message driven via asynchronously methods -Communication within the system should be done via done via asynchronous immutable events, rather than long procedural code.
  32. -This naturally promotes highly decoupled code. Sender and recipient can be constructed without having to know - or care - about implementation details of the others. I think this is a very important point… and is perhaps the most important facet of Reactive programming as the others may come naturally from adopting this single step By dealing with Message passing instead of direct function calls, this tends to result in building smaller, independent functions Fits nicely into a concurrent, asynchronous framework, whether it be an entire stack like Ratpack, a framework like Netty, or a library like GPars
  33. However, we humans are not good at Concurrency. Things like Thread safety are very hard. Thus, Reactive systems call for using techniques to abstract the concurrent procedures
  34. One of the shortcomings of the Reactive Manifesto is that it doesn’t offer concrete examples of what to do, it merely provides a set of principles.
  35. Because Concurrency is Hard, The Reactive Manifesto folks highly recommend the Actor pattern.
  36. Obviously, they’re going to recommend their own tools, Particularly their “Reactive Platform” product, which is a bundle including Scala, Play framework, Spark, and this library, Akka Akka is a library for Actors that you can use on it’s own
  37. very complicated Each actor is a small code block that knows to do a specific action actors == function ? actors are not accessed directly, instead actors exist within an ‘Actor System’. you interact with the system instead of the actors directly. The system abstracts the concurrency techniques
  38. But for all these diagrams up here, you really only have to end up creating the Actor code itself.
  39. show example code of an actor This is code from a small demo I worked up a while ago. This toy demo was a simulation of Paddy’s Pub from It’s Always Sunny in Philadelphia. Each of the Drinkers received a message in the form of a Drink, and would reject it if it was not a full point (see line 21)
  40. Actors each have a ‘mailbox’, and the code you write has to address messages onto the next actor The actor system than delivers these messages asynchronously
  41. Actor systems are very scalable. Can be distributed across threads or even additional systems
  42. Anyway, enough about actors
  43. It should be understood that being reactive is not about any particular architecture, rather it’s a mindset one should follow. And a goal to achieve. By building small, asynchronous, non blocking, resilient code, this allows us to create highly scalable, performant systems to meet user demand.
  44. Microservices are an excellent derivation of the Reactive mindset, assuming of course that you follow these 4 principles (e.g. build your services to be resilient). It’s also excellent that Spring, particularly now with the rise of Spring Boot, have been pushing us developers towards this trend
  45. pause next up is Reactive streams  or Reactive Extensions (also known as RX)  - Anyway, Rx is a powerful new programming pattern which has been gaining traction recently.
  46. If I were to try and describe Rx to you in one sentence, it would be… <read> Now, this may not be entirely correct, but it’s my observation after having worked with this technology for a while now. Fairly dramatic, eh?
  47. A mouthful, eh? Now compare that with a more succinct definition:
  48. I put a link to the video here as I’m going to mention it again Anyway, what does something like this even look like? What does something as dramatic as that even look like in terms of code?
  49. At first glance, and as you might guess, Reactive Streams look just like stream or pipeline based programming. Is everyone here familiar with Streams or pipelines? Not going to sell you. see Fowler. But here’s a quick example
  50. at first glance, it might seem fairly close to stream or pipeline based programming. Like the Java 8 streams api, or if we decided to chain together some of the groovy closure functions like collect or find. functional programming on data collections, rather than imperative statements in a loop - The reason why we call it Reactive extensions is that it adds functionality onto streams, “streams++” <Go Over example> However… Rx is vastly more complicated than that.
  51. But first, a story! Rx has a fairly interesting history The idea of reactive extensions came out of Microsoft’s “Cloud Programability team” sometime before 2008. It was designed as an interface for integrating multiple asynchronous data sources in the cloud. This became popular, and the library made it’s way into .NET
  52. Github used it for everything within their GH for Windows app
  53. And they loved it! So much so that in 2012 they decided to port the Rx technology to other languages and platforms, so that they could use it throughout the organization
  54. And in a highly coincidental move, MS decided at that same year to open source their Rx technology.
  55. And it’s amazing they did that. As a result, several heavy hitters in the JVM space decided to bring the tech to Java
  56. People from Netflix, Pivotal, Typesafe, Twitter, and many others came together. They made a spec, found at reactive-streams.org to flesh out further how Rx should work.
  57. As of a few days ago, we have several libraries which fully adhere to the spec.
  58. So anyway, what’s all the fuss? There’s clearly a reason why all those developers fell in love with itRx is some extensions on the concept of stream programming.
  59. So anyway, what’s all the fuss? Rx is some extensions on the concept of stream programming.
  60. Typically when working with an array or an iterable, one loops over the collection, and then pulls out data. I f I were to ask for the data at position 1 in an array, that’s an example of pulling information from the array. It sits there passively until I ask for it. with Rx it’s a bit different, in that our streams are configured to have data ‘pushed’ at them, without asking for it directly.
  61. which brings us to the next topic. The key components in this pattern: the Observable and the Subscriber. Subscriber may also be called an Observer, and the Observable may sometimes be called a Stream
  62. <Read> When an observable has a new data item, it pushes out to its subscribers. The subscriber acts as a ‘sentinel’, waiting, potentially asynchronously, for the next data item The observable interface is fairly simplistic: it can do 3 things: send a piece of data, signal that an error occurred, or signal that the data is complete.
  63. Which leads nicely into this next section. When talking about Observables, it’s important to note whether the Observable is ‘Hot’ or ‘Cold’
  64. A ‘Cold’ Observable is the most accessible or direct kind. If you’re just starting out, you’re almost certainly going to entirely be using Cold Observables. This is an example of one… generating an observable from a finite list of data
  65. Hot is a bit different and more advanced slide of a created observable <explain> Two more points come out of this slide, the first being that…
  66. streams are composable.
  67. Here we have a stream of sales data being attached to a variable called ‘branch’. both of the subscribers listening on the ‘branch’ variable are receiving the same data that the stream emits
  68. Second is, async behavior is EASY
  69. Backpressure is the concept that a subscriber should alert a publisher that it’s sending information to quickly for the subscriber Publishers should not overload subscribers
  70. One of the most basic versions of this
  71. Finally, I think this next point is perhaps the most powerful aspect of RX. It’s possible do some wild things with multiple observables. Can combine them certainly, but it’s also possible to have an observable refrain from emitting data until another observable does, or have an observable emit data until it receives data from another observable.
  72. I’m sure many of us here have written event handlers, event listeners, or have event used something like a listen ONCE handler to unsubscribe. I mentioned a man from Netflix named Jafar Husain earlier, along with a link to a video. You all should find that link and go watch that when you have a moment. One of his key take aways about RX… and this has a JS slant… is that… <read slide>
  73. Auto complete How many lines of code do you think it is to do this? Excluding the rendering of each image, or course.
  74. granted, the ‘updateSearchResults’ function is likely a bit lengthily.
  75. akka and…
  76. Can be a bit intimidating at first
  77. Infamous for having colorful, but often confusing diagrams
  78. and the descriptions can be a little… obtuse, too.
  79. … So it’s a Reactive -Stream Based web server.
  80. One of the downsides? Like anything, the documentation is missing many sections. Although, to be fair, the documentation is rapidly improving. It took me 5 sections to find the first ‘TODO’ they also have a very welcoming slack channel. I joined hoping to ask the experts a quick question about configuration. Within 30 minutes or so, I had lengthy, helpful answers from several people (one of them the creator). Also, I was yelled at by fellow speaker dan woods, so, you know, all in all a good time
  81. lmax ring buffer: LMAX is a financial trading company that is trying to build the fastest trading platform in the world. They open sourced key piece of their technology, called the Disrupter which is based on a ring buffer pattern. Also, In addition to Rx, Reactor allows you to do efficient internal message passing and build Event Driven apps.
  82. Reactor offers several options for your apps… including using either Reactive streams or what they call the Reactor bus Suppose we had an E-commerce app which included a service which created and processed orders. In this version, we use several additional service collaborators to do things like verifying that we have inventory, charge the user, and send emails if successful or not. Each of those service calls could take a while (checking inventory, sending email, money), which blocks the thread while we wait for each service call. This slows down the request not only for the end user but for any rampaging hordes trying to access our app
  83. Here’s that same method. Where did the rest of the code go? First, note the ‘notify’ with a String-based event
  84. On order:created, we execute the first services job Then we check the inventory for holding, and broadcast a new event based on those results
  85. The moneyService will bill the client if the inventory is good, While the email service will respond either way. -Now, some of might be saying, “But Steve, that code is spread across 3 different slides!”. While, true, which of these would you rather use? Which version do you think is more decoupled? Which would be easier to test? -(Imagine having to mock all these services as collaborators, versus simply creating events)
  86. GPARS! There will a talk just on GPars alone tomorrow by Ken Kousen. So look out for that one
  87. load demo app basic print group by user, filter by items greater than 5 or something separate stream for 0 only go back and group by user and then location
  88. - know when to async / when not to async
  89. All this talk about streams and java… you might be wondering “Why didn’t Steve talk about Java 8 Streams?”
  90. Java 8 Streams API      -at first seems great      - built into the language!      - streams api meant for finite iterable objects to pull from - parallelization support is weak. Uses a common resource pool (ForkJoin) for all parallel stream operations, across threads.      - observables deal with potentially infinite streams the subscribers receive and can offer backpressure
  91. I hope you find this presentation, at the very least thought provoking, along with the several others on Reactive that are at this conference. I think it’s telling that there are 4 or 5 talks on Reactive this year. I think that as the popularity of Microservices increases
  92. I mentioned earlier that Microservices can be an excellent application of Reactive. To clarify, I believe that being Reactive, following the Reactive Principles, thinking in terms of streams… are the blueprint of how Microservices should be built in order to succeed.