SlideShare a Scribd company logo
© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
Part 3 :: Reactive with Spring
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
2
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
3
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
4
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
5
Topics
Reactive architecture vs Programming
Spring Reactive
Why and What Reactive ?
Demo
Q/A
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
6
Why and What
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
7
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
8
Why Reactive ?
System
10K request/second
5K
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
9
Why Reactive ?
System
10K request/second
20K
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
10
Why Reactive ?
System
10K request/second
20K
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
11
Problems
Outage system
User/business dissatisfied
Slow response
Potential customer and money were lost
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
12
Need better system
Need better principles
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
13
Robust Responsive
Elasticity
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
14
Reactive System
https://www.reactivemanifesto.org/
Responsive Resilient
Elastic
Message
driven
Async messaging
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
15
Reactive …
React to load => Elastic
React to failure => Resilient
React to events => Event/message-driven
React to users => Responsive
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
16
Reactive Manifesto
https://www.reactivemanifesto.org/
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
17
Reactive Manifesto
https://www.reactivemanifesto.org/
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
18
Message-driven communication
Service 1
Service 2
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
19
Message-driven communication
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
20
Non-blocking message
communication
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
21
Efficient resource utilization


when communicating between
services in distributed system
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
22
Using message broker
Service 1
Service 2
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
23
Reactive System
https://www.reactivemanifesto.org/
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
24
Sync Async
Blocking
Non-Blocking
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
25
Reactive programming
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
26
Reactive programming
Service 1
Service 2
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
27
Reactive programming
Subset of Asynchronous programming
Decompose the problem into multiple discrete step
Implementation technique
Asynchronous and non-blocking
Dataflow/stream programming
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
28
https://mostafa-asg.github.io/post/reactive-systems-vs-reactive-programming/
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
29
API for Reactive programming
Declarative with functional composition
Callback
Observer
Iterator
Send data
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
30
Stream everywhere
https://reactive.how/
Many processes can be modeled as a stream
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
31
Stream everywhere
Many processes can be modeled as a stream
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
32
JVM Reactive Libraries
Vert.X
Akka
RxJava
http://reactivex.io/languages.html
Ratpack
Reactor
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
33
Benefits Reactive programming
Increase performance by reduce serialization point
Developer productivity
Increase utilization of computing resources
Avoid over-utilization (back-pressure)
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
34
Back-pressure
To prevent systemic failures
https://www.baeldung.com/spring-webflux-backpressure
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
35
Spring Reactive
https://spring.io/reactive
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
36
Spring Reactive
https://spring.io/reactive
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
37
Spring WebFlux
Use project Reactor
Reactive programming support for web app
Mono = one-to-one
Flux = one to many
https://projectreactor.io/
Publisher implementations
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
38
Flux vs Mono
Handling zero(optional) or one result
Mono
Handling zero(optional) or many results (infinite)
Flux
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
39
Lirarary Types
RxJS Observable
Spring Web
fl
ux Mono or Flux
Java 9+ Flow
https://www.reactive-streams.org/
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
40
Spring WebFlux
RDBMS


Database
Controller
Spring Webflux Spring Data R2DBC
https://spring.io/projects/spring-data-r2dbc
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
41
Reactive Relational Database Connectivity
https://spring.io/projects/spring-data-r2dbc
MySQL, MariaDB
PostgreSQL
H2
SQL Server
Oracle
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
42
Spring WebFlux
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
43
Spring WebFlux
Spring
WebFlux
Client
WebClient
https://spring.io/projects/spring-data-r2dbc
Spring MVC/
Boot
Client
RestTemplate
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
44
Demo


Reactive REST application
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
45
Create Project
https://start.spring.io/
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
46
Flux and Mono
Reactive REST
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
47
Performance testing
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
48
Simple REST (default = 200)
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
49
WebFlux
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
50
REST vs WebFlux
Use delay = 3 seconds
Spring Reactive


© 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved.
51
Q/A

More Related Content

What's hot

Quality Assurance in fast paced DevOps projects using automation - Patrick Ve...
Quality Assurance in fast paced DevOps projects using automation - Patrick Ve...Quality Assurance in fast paced DevOps projects using automation - Patrick Ve...
Quality Assurance in fast paced DevOps projects using automation - Patrick Ve...
Sogeti Nederland B.V.
 
Fotos infosecurity 2018
Fotos infosecurity 2018Fotos infosecurity 2018
Fotos infosecurity 2018
Miguel Hernández y López
 
Making the Difficult, Simple(r)
Making the Difficult, Simple(r)Making the Difficult, Simple(r)
Making the Difficult, Simple(r)
Julian Macagno
 
Making the Difficult, Simple(r)
Making the Difficult, Simple(r)Making the Difficult, Simple(r)
Making the Difficult, Simple(r)
Ken Tabor
 
Failing Fast - An Autopsy of a Failed Release
Failing Fast - An Autopsy of a Failed ReleaseFailing Fast - An Autopsy of a Failed Release
Failing Fast - An Autopsy of a Failed Release
johnfcshaw
 
Is React The Best Thing Since Sliced Bread?
Is React The Best Thing Since Sliced Bread?Is React The Best Thing Since Sliced Bread?
Is React The Best Thing Since Sliced Bread?
Synerzip
 
Cips Meetup Auckland-Mirko-Kleiner-lean-agile-procurement-201904-1.0
Cips Meetup Auckland-Mirko-Kleiner-lean-agile-procurement-201904-1.0Cips Meetup Auckland-Mirko-Kleiner-lean-agile-procurement-201904-1.0
Cips Meetup Auckland-Mirko-Kleiner-lean-agile-procurement-201904-1.0
Mirko Kleiner
 
Alexander Andelkovic. Comaqa Spring 2018. Using Artificial Intelligence to Te...
Alexander Andelkovic. Comaqa Spring 2018. Using Artificial Intelligence to Te...Alexander Andelkovic. Comaqa Spring 2018. Using Artificial Intelligence to Te...
Alexander Andelkovic. Comaqa Spring 2018. Using Artificial Intelligence to Te...
COMAQA.BY
 
Agile Quality Improvement 7: common challenges and good practices - Wouter Ru...
Agile Quality Improvement 7: common challenges and good practices - Wouter Ru...Agile Quality Improvement 7: common challenges and good practices - Wouter Ru...
Agile Quality Improvement 7: common challenges and good practices - Wouter Ru...
Sogeti Nederland B.V.
 
Cover Your Apps While Still Using npm
Cover Your Apps While Still Using npmCover Your Apps While Still Using npm
Cover Your Apps While Still Using npm
Tierney Cyren
 
Ryanair presentation- Future of BDD in Ryanair
Ryanair presentation- Future of BDD in RyanairRyanair presentation- Future of BDD in Ryanair
Ryanair presentation- Future of BDD in Ryanair
Cigniti Technologies Ltd
 

What's hot (11)

Quality Assurance in fast paced DevOps projects using automation - Patrick Ve...
Quality Assurance in fast paced DevOps projects using automation - Patrick Ve...Quality Assurance in fast paced DevOps projects using automation - Patrick Ve...
Quality Assurance in fast paced DevOps projects using automation - Patrick Ve...
 
Fotos infosecurity 2018
Fotos infosecurity 2018Fotos infosecurity 2018
Fotos infosecurity 2018
 
Making the Difficult, Simple(r)
Making the Difficult, Simple(r)Making the Difficult, Simple(r)
Making the Difficult, Simple(r)
 
Making the Difficult, Simple(r)
Making the Difficult, Simple(r)Making the Difficult, Simple(r)
Making the Difficult, Simple(r)
 
Failing Fast - An Autopsy of a Failed Release
Failing Fast - An Autopsy of a Failed ReleaseFailing Fast - An Autopsy of a Failed Release
Failing Fast - An Autopsy of a Failed Release
 
Is React The Best Thing Since Sliced Bread?
Is React The Best Thing Since Sliced Bread?Is React The Best Thing Since Sliced Bread?
Is React The Best Thing Since Sliced Bread?
 
Cips Meetup Auckland-Mirko-Kleiner-lean-agile-procurement-201904-1.0
Cips Meetup Auckland-Mirko-Kleiner-lean-agile-procurement-201904-1.0Cips Meetup Auckland-Mirko-Kleiner-lean-agile-procurement-201904-1.0
Cips Meetup Auckland-Mirko-Kleiner-lean-agile-procurement-201904-1.0
 
Alexander Andelkovic. Comaqa Spring 2018. Using Artificial Intelligence to Te...
Alexander Andelkovic. Comaqa Spring 2018. Using Artificial Intelligence to Te...Alexander Andelkovic. Comaqa Spring 2018. Using Artificial Intelligence to Te...
Alexander Andelkovic. Comaqa Spring 2018. Using Artificial Intelligence to Te...
 
Agile Quality Improvement 7: common challenges and good practices - Wouter Ru...
Agile Quality Improvement 7: common challenges and good practices - Wouter Ru...Agile Quality Improvement 7: common challenges and good practices - Wouter Ru...
Agile Quality Improvement 7: common challenges and good practices - Wouter Ru...
 
Cover Your Apps While Still Using npm
Cover Your Apps While Still Using npmCover Your Apps While Still Using npm
Cover Your Apps While Still Using npm
 
Ryanair presentation- Future of BDD in Ryanair
Ryanair presentation- Future of BDD in RyanairRyanair presentation- Future of BDD in Ryanair
Ryanair presentation- Future of BDD in Ryanair
 

Similar to Sck spring-reactive

vTalk#1 Microservices with Spring Boot
vTalk#1 Microservices with Spring BootvTalk#1 Microservices with Spring Boot
vTalk#1 Microservices with Spring Boot
Somkiat Puisungnoen
 
Wordpress for Newbie
Wordpress for NewbieWordpress for Newbie
Wordpress for Newbie
Somkiat Puisungnoen
 
Shared code between projects
Shared code between projectsShared code between projects
Shared code between projects
Somkiat Puisungnoen
 
SCK Firestore at CNX
SCK Firestore at CNXSCK Firestore at CNX
SCK Firestore at CNX
Somkiat Puisungnoen
 
Building Microservices with the 12 Factor App Pattern on AWS - Tony Pujals
Building Microservices with the 12 Factor App Pattern on AWS - Tony PujalsBuilding Microservices with the 12 Factor App Pattern on AWS - Tony Pujals
Building Microservices with the 12 Factor App Pattern on AWS - Tony Pujals
Amazon Web Services
 
Visual testing
Visual testingVisual testing
Visual testing
Somkiat Puisungnoen
 
Angular vs. React
Angular vs. ReactAngular vs. React
Angular vs. React
OPITZ CONSULTING Deutschland
 
20182712 Camunda Meetup Berlin_Andrey Shchagin
20182712 Camunda Meetup Berlin_Andrey Shchagin20182712 Camunda Meetup Berlin_Andrey Shchagin
20182712 Camunda Meetup Berlin_Andrey Shchagin
camunda services GmbH
 
Manage data of service
Manage data of serviceManage data of service
Manage data of service
Somkiat Puisungnoen
 
MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...
MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...
MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...
MongoDB
 
Building Microservices with the 12 Factor App Pattern on AWS
Building Microservices with the 12 Factor App Pattern on AWSBuilding Microservices with the 12 Factor App Pattern on AWS
Building Microservices with the 12 Factor App Pattern on AWS
Amazon Web Services
 
Clean you code
Clean you codeClean you code
Clean you code
Somkiat Puisungnoen
 
Automatic for the People
Automatic for the PeopleAutomatic for the People
Automatic for the People
Allon Mureinik
 
CWIN17 telford application integration and ap is - lisa eckersley
CWIN17 telford   application integration and ap is - lisa eckersleyCWIN17 telford   application integration and ap is - lisa eckersley
CWIN17 telford application integration and ap is - lisa eckersley
Capgemini
 
IDC Architecture 2016 - Devops and Open Source
IDC Architecture 2016 - Devops and Open SourceIDC Architecture 2016 - Devops and Open Source
IDC Architecture 2016 - Devops and Open Source
{code}
 
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Edureka!
 
Microservices and APIs
Microservices and APIsMicroservices and APIs
Microservices and APIs
Puneet Sachdev
 
RobotFramework Meetup at Thailand #2
RobotFramework Meetup at Thailand #2RobotFramework Meetup at Thailand #2
RobotFramework Meetup at Thailand #2
Somkiat Puisungnoen
 
Building Microservices with the 12 Factor App Pattern on AWS.pdf
Building Microservices with the 12 Factor App Pattern on AWS.pdfBuilding Microservices with the 12 Factor App Pattern on AWS.pdf
Building Microservices with the 12 Factor App Pattern on AWS.pdf
Amazon Web Services
 
Intro to service mesh & Istio
Intro to service mesh & IstioIntro to service mesh & Istio
Intro to service mesh & Istio
Rinor Maloku
 

Similar to Sck spring-reactive (20)

vTalk#1 Microservices with Spring Boot
vTalk#1 Microservices with Spring BootvTalk#1 Microservices with Spring Boot
vTalk#1 Microservices with Spring Boot
 
Wordpress for Newbie
Wordpress for NewbieWordpress for Newbie
Wordpress for Newbie
 
Shared code between projects
Shared code between projectsShared code between projects
Shared code between projects
 
SCK Firestore at CNX
SCK Firestore at CNXSCK Firestore at CNX
SCK Firestore at CNX
 
Building Microservices with the 12 Factor App Pattern on AWS - Tony Pujals
Building Microservices with the 12 Factor App Pattern on AWS - Tony PujalsBuilding Microservices with the 12 Factor App Pattern on AWS - Tony Pujals
Building Microservices with the 12 Factor App Pattern on AWS - Tony Pujals
 
Visual testing
Visual testingVisual testing
Visual testing
 
Angular vs. React
Angular vs. ReactAngular vs. React
Angular vs. React
 
20182712 Camunda Meetup Berlin_Andrey Shchagin
20182712 Camunda Meetup Berlin_Andrey Shchagin20182712 Camunda Meetup Berlin_Andrey Shchagin
20182712 Camunda Meetup Berlin_Andrey Shchagin
 
Manage data of service
Manage data of serviceManage data of service
Manage data of service
 
MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...
MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...
MongoDB World 2018: From Disruption to Transformation: Document Databases, Do...
 
Building Microservices with the 12 Factor App Pattern on AWS
Building Microservices with the 12 Factor App Pattern on AWSBuilding Microservices with the 12 Factor App Pattern on AWS
Building Microservices with the 12 Factor App Pattern on AWS
 
Clean you code
Clean you codeClean you code
Clean you code
 
Automatic for the People
Automatic for the PeopleAutomatic for the People
Automatic for the People
 
CWIN17 telford application integration and ap is - lisa eckersley
CWIN17 telford   application integration and ap is - lisa eckersleyCWIN17 telford   application integration and ap is - lisa eckersley
CWIN17 telford application integration and ap is - lisa eckersley
 
IDC Architecture 2016 - Devops and Open Source
IDC Architecture 2016 - Devops and Open SourceIDC Architecture 2016 - Devops and Open Source
IDC Architecture 2016 - Devops and Open Source
 
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
 
Microservices and APIs
Microservices and APIsMicroservices and APIs
Microservices and APIs
 
RobotFramework Meetup at Thailand #2
RobotFramework Meetup at Thailand #2RobotFramework Meetup at Thailand #2
RobotFramework Meetup at Thailand #2
 
Building Microservices with the 12 Factor App Pattern on AWS.pdf
Building Microservices with the 12 Factor App Pattern on AWS.pdfBuilding Microservices with the 12 Factor App Pattern on AWS.pdf
Building Microservices with the 12 Factor App Pattern on AWS.pdf
 
Intro to service mesh & Istio
Intro to service mesh & IstioIntro to service mesh & Istio
Intro to service mesh & Istio
 

More from Somkiat Puisungnoen

Cloud Native App
Cloud Native AppCloud Native App
Cloud Native App
Somkiat Puisungnoen
 
Unhappiness Developer
Unhappiness DeveloperUnhappiness Developer
Unhappiness Developer
Somkiat Puisungnoen
 
The Beauty of BAD code
The Beauty of  BAD codeThe Beauty of  BAD code
The Beauty of BAD code
Somkiat Puisungnoen
 
React in the right way
React in the right wayReact in the right way
React in the right way
Somkiat Puisungnoen
 
Rise of Container (RoC)
Rise of Container (RoC)Rise of Container (RoC)
Rise of Container (RoC)
Somkiat Puisungnoen
 
SCK :: Scrum is NOT Enough
SCK :: Scrum is NOT EnoughSCK :: Scrum is NOT Enough
SCK :: Scrum is NOT Enough
Somkiat Puisungnoen
 
Software Development Trends 2017 at IMC
Software Development Trends 2017 at IMCSoftware Development Trends 2017 at IMC
Software Development Trends 2017 at IMC
Somkiat Puisungnoen
 
Design pattern with Java 8
Design pattern with Java 8Design pattern with Java 8
Design pattern with Java 8
Somkiat Puisungnoen
 
Meetup :: Update Elastic Stack 5.0
Meetup :: Update Elastic Stack 5.0Meetup :: Update Elastic Stack 5.0
Meetup :: Update Elastic Stack 5.0
Somkiat Puisungnoen
 
Git as NoSQL
Git as NoSQLGit as NoSQL
Git as NoSQL
Somkiat Puisungnoen
 
DevOps 101
DevOps 101DevOps 101
Sck Mobile Application Security
Sck Mobile Application SecuritySck Mobile Application Security
Sck Mobile Application Security
Somkiat Puisungnoen
 
Automation test for Android
Automation test for AndroidAutomation test for Android
Automation test for Android
Somkiat Puisungnoen
 
Secure Test-Driven Development
Secure Test-Driven DevelopmentSecure Test-Driven Development
Secure Test-Driven Development
Somkiat Puisungnoen
 
Working with branch
Working with branchWorking with branch
Working with branch
Somkiat Puisungnoen
 

More from Somkiat Puisungnoen (16)

devops
devops devops
devops
 
Cloud Native App
Cloud Native AppCloud Native App
Cloud Native App
 
Unhappiness Developer
Unhappiness DeveloperUnhappiness Developer
Unhappiness Developer
 
The Beauty of BAD code
The Beauty of  BAD codeThe Beauty of  BAD code
The Beauty of BAD code
 
React in the right way
React in the right wayReact in the right way
React in the right way
 
Rise of Container (RoC)
Rise of Container (RoC)Rise of Container (RoC)
Rise of Container (RoC)
 
SCK :: Scrum is NOT Enough
SCK :: Scrum is NOT EnoughSCK :: Scrum is NOT Enough
SCK :: Scrum is NOT Enough
 
Software Development Trends 2017 at IMC
Software Development Trends 2017 at IMCSoftware Development Trends 2017 at IMC
Software Development Trends 2017 at IMC
 
Design pattern with Java 8
Design pattern with Java 8Design pattern with Java 8
Design pattern with Java 8
 
Meetup :: Update Elastic Stack 5.0
Meetup :: Update Elastic Stack 5.0Meetup :: Update Elastic Stack 5.0
Meetup :: Update Elastic Stack 5.0
 
Git as NoSQL
Git as NoSQLGit as NoSQL
Git as NoSQL
 
DevOps 101
DevOps 101DevOps 101
DevOps 101
 
Sck Mobile Application Security
Sck Mobile Application SecuritySck Mobile Application Security
Sck Mobile Application Security
 
Automation test for Android
Automation test for AndroidAutomation test for Android
Automation test for Android
 
Secure Test-Driven Development
Secure Test-Driven DevelopmentSecure Test-Driven Development
Secure Test-Driven Development
 
Working with branch
Working with branchWorking with branch
Working with branch
 

Recently uploaded

Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 

Recently uploaded (20)

Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 

Sck spring-reactive

  • 1. © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. Part 3 :: Reactive with Spring
  • 2. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 2
  • 3. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 3
  • 4. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 4
  • 5. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 5 Topics Reactive architecture vs Programming Spring Reactive Why and What Reactive ? Demo Q/A
  • 6. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 6 Why and What
  • 7. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 7
  • 8. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 8 Why Reactive ? System 10K request/second 5K
  • 9. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 9 Why Reactive ? System 10K request/second 20K
  • 10. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 10 Why Reactive ? System 10K request/second 20K
  • 11. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 11 Problems Outage system User/business dissatisfied Slow response Potential customer and money were lost
  • 12. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 12 Need better system Need better principles
  • 13. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 13 Robust Responsive Elasticity
  • 14. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 14 Reactive System https://www.reactivemanifesto.org/ Responsive Resilient Elastic Message driven Async messaging
  • 15. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 15 Reactive … React to load => Elastic React to failure => Resilient React to events => Event/message-driven React to users => Responsive
  • 16. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 16 Reactive Manifesto https://www.reactivemanifesto.org/
  • 17. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 17 Reactive Manifesto https://www.reactivemanifesto.org/
  • 18. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 18 Message-driven communication Service 1 Service 2
  • 19. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 19 Message-driven communication
  • 20. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 20 Non-blocking message communication
  • 21. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 21 Efficient resource utilization when communicating between services in distributed system
  • 22. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 22 Using message broker Service 1 Service 2
  • 23. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 23 Reactive System https://www.reactivemanifesto.org/
  • 24. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 24 Sync Async Blocking Non-Blocking
  • 25. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 25 Reactive programming
  • 26. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 26 Reactive programming Service 1 Service 2
  • 27. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 27 Reactive programming Subset of Asynchronous programming Decompose the problem into multiple discrete step Implementation technique Asynchronous and non-blocking Dataflow/stream programming
  • 28. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 28 https://mostafa-asg.github.io/post/reactive-systems-vs-reactive-programming/
  • 29. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 29 API for Reactive programming Declarative with functional composition Callback Observer Iterator Send data
  • 30. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 30 Stream everywhere https://reactive.how/ Many processes can be modeled as a stream
  • 31. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 31 Stream everywhere Many processes can be modeled as a stream
  • 32. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 32 JVM Reactive Libraries Vert.X Akka RxJava http://reactivex.io/languages.html Ratpack Reactor
  • 33. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 33 Benefits Reactive programming Increase performance by reduce serialization point Developer productivity Increase utilization of computing resources Avoid over-utilization (back-pressure)
  • 34. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 34 Back-pressure To prevent systemic failures https://www.baeldung.com/spring-webflux-backpressure
  • 35. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 35 Spring Reactive https://spring.io/reactive
  • 36. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 36 Spring Reactive https://spring.io/reactive
  • 37. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 37 Spring WebFlux Use project Reactor Reactive programming support for web app Mono = one-to-one Flux = one to many https://projectreactor.io/ Publisher implementations
  • 38. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 38 Flux vs Mono Handling zero(optional) or one result Mono Handling zero(optional) or many results (infinite) Flux
  • 39. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 39 Lirarary Types RxJS Observable Spring Web fl ux Mono or Flux Java 9+ Flow https://www.reactive-streams.org/
  • 40. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 40 Spring WebFlux RDBMS Database Controller Spring Webflux Spring Data R2DBC https://spring.io/projects/spring-data-r2dbc
  • 41. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 41 Reactive Relational Database Connectivity https://spring.io/projects/spring-data-r2dbc MySQL, MariaDB PostgreSQL H2 SQL Server Oracle
  • 42. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 42 Spring WebFlux
  • 43. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 43 Spring WebFlux Spring WebFlux Client WebClient https://spring.io/projects/spring-data-r2dbc Spring MVC/ Boot Client RestTemplate
  • 44. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 44 Demo Reactive REST application
  • 45. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 45 Create Project https://start.spring.io/
  • 46. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 46 Flux and Mono Reactive REST
  • 47. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 47 Performance testing
  • 48. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 48 Simple REST (default = 200)
  • 49. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 49 WebFlux
  • 50. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 50 REST vs WebFlux Use delay = 3 seconds
  • 51. Spring Reactive © 2017 - 2018 Siam Chamnankit Company Limited. All rights reserved. 51 Q/A