While Reactive Programming is very different from the usual Imperative way, there’s no denying it fits “the Cloud”, as every bit of resource is used to its fullest. Let’s see how to migrate from the latter to the former using a Spring Boot web app as an example.
3. @nicolas_frankel
Hazelcast
HAZELCAST IMDG is an operational,
in-memory, distributed computing
platform that manages data using
in-memory storage and performs
execution for breakthrough
and scale.
HAZELCAST JET is the ultra
fast, application embeddable,
3rd generation stream
processing engine for low
latency batch and stream
processing.
4. @nicolas_frankel
2014: The Reactive Manifesto
Responsive: “The system responds in a
timely manner if at all possible”
Resilient: “The system stays responsive
in the face of failure”
Elastic: “The system stays responsive
under varying workload”
Message Driven: “Reactive Systems rely
on asynchronous message-passing”
6. @nicolas_frankel
Reactive Streams
“The purpose of Reactive Streams is to
provide a standard for asynchronous
stream processing with non-blocking
backpressure”
-- https://www.reactive-streams.org/
9. @nicolas_frankel
Downsides of Reactive
More complex mental model
Harder to debug
Specific APIs
One single blocking call in the call chain
and it’s not reactive anymore!
12. @nicolas_frankel
JDK 9 Flow
“There will be a migratory period, while
libraries move to adopt the new types in
the JDK, however this period is expected
to be short” 😂
• JDK 9 2017
org.reactivestreams.FlowAdapters
16. @nicolas_frankel
Summary
Migrate to Functional APIs first
Everything needs to be reactive
• Blockhound for the win
More work but nothing impossible
Coroutines make non-blocking easier
Don’t use Reactive because others do!
17. @nicolas_frankel
Thanks for your time!
https://blog.frankel.ch/
@nicolas_frankel
https://hazelcast.org/blog/migrating-from-
imperative-to-reactive/
http://bit.ly/to-reactive
https://slack.hazelcast.com/