thoughts about reactive programming

10
Thoughts About Reactive Programming Matheus Moreira

Upload: matheus-eduardo-machado-moreira

Post on 06-Apr-2017

37 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Thoughts About Reactive Programming

Thoughts About Reactive Programming

Matheus Moreira

Page 2: Thoughts About Reactive Programming

Reactive Programming - What

● ???○ reactive manifesto

■ responsive■ elastic■ resilient■ message driven

○ akka○ micro-architecture style

○ programming paradigm

○ functional programming

Page 3: Thoughts About Reactive Programming

Reactive Programming - What

“Reactive programming is programming with asynchronous data streams. (...) On top of that, you are given an amazing toolbox of functions to combine, create and filter any of those streams.”

Page 4: Thoughts About Reactive Programming

Reactive Programming - What

● stream○ ongoing events ordered in time...

○ captured asynchronously…

○ by a subscriber

Page 5: Thoughts About Reactive Programming

Reactive Programming - What

● toolbox○ create (click)

○ combine (buffer, throttle, map)

○ filter

● functional programming○ reduce, filter, map, flatMap○ declarative vs imperative

■ operation-fusion

Page 6: Thoughts About Reactive Programming

Reactive Programming - What

● backpressure○ coping with observables that produce items more rapidly than their

observers (subscribers) consume them■ unbound consumption of resources

○ feedback mechanism

Page 7: Thoughts About Reactive Programming

Reactive Programming - Why

● concurrency● composability

○ streams (1)

○ Futures (1, 2, 3)

○ callbacks (1)

● netflix○ entire service layer asynchronous (or it appears to be so)

○ blocking and non-blocking ops hidden behind Observable

● better usage of resources● better error handling / graceful degradation

Page 8: Thoughts About Reactive Programming

Reactive Programming - How

● reactive streams○ low level contract (not meant to be a public api)○ different libraries working together, especially back-pressure

● rxjava (netflix)● reactor● spring framework 5.0

○ streams part of web layer (controllers)● akka / akka streams● javascript

○ rxjs○ bacon.js

Page 9: Thoughts About Reactive Programming

Reactive Programming - References

● thoughts about reactive programming○ follow the links!

○ notes on reactive programming series on spring's blog offers a

bottom-up perspective that finishes with an interesting big picture

scenario (reactive all the way down)

○ posts on netflix's blog give insights about how reactive programming

can transform your api■ resource allocation■ search for circuit-break pattern too, and hystrix implementation of it■ monitoring

● reactive programming vs reactive systems

Page 10: Thoughts About Reactive Programming

Reactive Programming - Chat time!

Let's talk about it!

Matheus Moreira

[email protected]

https://br.linkedin.com/in/matheusmoreira