SlideShare a Scribd company logo
1 of 54
ReactiveProgramming @ Scale
Paul Downey
● Director of UI & APIs for demand advertising
● Based in Dublin, Ireland
● Email: paul.downey@teamaol.com
John McClean
● Systems Architect Demand Side Forecasting
● Based in Dublin, Ireland.
● Twitter: cyclops_aol
● Medium: https://medium.com/@johnmcclean
● Email: john.mcclean@teamaol.com
About Speakers
A
A
A
P
P
P
Exchange
RTB Ad Cycle
100 ms
20,000,000,000+
● Responsive
● Scale
● Resilient
● Capacity to process lots of data
System Requirements
Moore’s Law
7
Race Conditions
Deadlocks
Contention
Non-Deterministic State
Thread Starvation
Livelocks
Amadahl’s Law
9
Concurrency in
Practice.
Java Concurrency In Theory
11
Java Concurrency In Practice
12
Why is it like this?
13
Why is it like this?
14
Can we fix this?
15
What is Reactive?
16
What is Reactive?
17
Functional Reactive Programming?
Actor based concurrency?
Functional Reactive
Programming.
Is it something new?
19
1997
Big in 1997?
20
Is it something new?
21
Well established on the front end
22
What is it?
Functional programming?
24
Functional programming
25
Less buggy code
Easier to parallelise
Easier to optimise
Reactive programming
26
Reactive pipeline manages flow
What not How
Reactive programming
27
What to do
Change each element by multiplying by 100
Remove all elements over 550
Print out each remaining element
Reactive programming
28
Composition
Change each element by multiplying by 100
Remove all elements over 550
Print out each remaining element
map(e -> e*100)
forEach(System.out::println)
filter(e->e<551)
Reactive programming
29
.map(e -> e*100)
.forEach(System.out::println)
.filter(e->e<551)
Example
ReactiveSeq.of(6,5,1,2)
A Reactive Pipeline
30
first stage second stage terminal stage
A Reactive Pipeline
31
first stage
(map)
second stage
(filter)
terminal stage
(forEach)
A Reactive Pipeline
32
first stage
(map)
second stage
(filter)
terminal stage
(forEach)
Data is pushed through the pipeline
500
2
1
5 600
Forecasting
Forecasting
34
Campaign Planning and Optimization
Query data across petabytes data
Accuracy & Responsiveness
Price / Volume Curve
Every Day We Process
36
Bid Request
Records
Impression Records Viewability Records
20B 2B 2B
Indexing Data
37
Reactive
Indexing
What we need to do
A Reactive Pipeline
40
first stage
(map)
second stage
(filter)
terminal stage
(forEach)
Data is pushed through the pipeline
500
2
1
5 600
Scaling Up
41
first stage
(map)
second stage
(filter)
terminal stage
(forEach)
core 1
first stage
(map)
second stage
(filter)
terminal stage
(forEach)
core 2
first stage
(map)
second stage
(filter)
terminal stage
(forEach)
core 3
first stage
(map)
second stage
(filter)
terminal stage
(forEach)
core 4
Scaling Up for I/O
42
first stage
(map)
second stage
(filter)
terminal stage
(forEach)
future 1
future 2
future 3
future 4
future 5
future 6
future 7
future 8
future 9
future
10 future
11
Performance Differences
43
What would the
code look like?
Sequential Stream
45
.map(e -> e*100)
.forEach(System.out::println)
.filter(e->e<551)
Example
ReactiveSeq.of(6,5,1,2)
.futureOperations(executor)
Async I/O
46
.map(e -> e*100)
.filter(e->e<551)
Example
FutureW.of(()->loadData(6))
//non-blocking, FutureW executes asynchronously
.forEach(System.out::println)
Parallel Async Stream
47
.map(this::loadData)
.forEach(System.out::println)
.filter(e->e<551)
Example
new LazyReact(100).of(6,5,1,2)
What we need to do
Reactive Indexing Architecture
49
What have we
learnt?
Conclusions
51
Conclusions
52
Conclusions
53
Thank You.

More Related Content

What's hot

2018,sem7,ala,pm,160993119017,160993119018,160993119019,160993119020,16099311...
2018,sem7,ala,pm,160993119017,160993119018,160993119019,160993119020,16099311...2018,sem7,ala,pm,160993119017,160993119018,160993119019,160993119020,16099311...
2018,sem7,ala,pm,160993119017,160993119018,160993119019,160993119020,16099311...
Siddharth Modi
 
Final Presentation-DATNYC
Final Presentation-DATNYCFinal Presentation-DATNYC
Final Presentation-DATNYC
Karen Zellner
 

What's hot (9)

2018,sem7,ala,pm,160993119017,160993119018,160993119019,160993119020,16099311...
2018,sem7,ala,pm,160993119017,160993119018,160993119019,160993119020,16099311...2018,sem7,ala,pm,160993119017,160993119018,160993119019,160993119020,16099311...
2018,sem7,ala,pm,160993119017,160993119018,160993119019,160993119020,16099311...
 
Spm
SpmSpm
Spm
 
GraphBolt: Dependency-Driven Synchronous Processing of Streaming Graphs
GraphBolt: Dependency-Driven Synchronous Processing of Streaming GraphsGraphBolt: Dependency-Driven Synchronous Processing of Streaming Graphs
GraphBolt: Dependency-Driven Synchronous Processing of Streaming Graphs
 
Operation research's CPM techniques
Operation research's CPM techniques Operation research's CPM techniques
Operation research's CPM techniques
 
Nrtl activity coefficient for mixture1
Nrtl activity coefficient for mixture1Nrtl activity coefficient for mixture1
Nrtl activity coefficient for mixture1
 
Global Grid of Grapes
Global Grid of GrapesGlobal Grid of Grapes
Global Grid of Grapes
 
Final Presentation-DATNYC
Final Presentation-DATNYCFinal Presentation-DATNYC
Final Presentation-DATNYC
 
Chapter 7: Production Economics
Chapter 7: Production EconomicsChapter 7: Production Economics
Chapter 7: Production Economics
 
Aaa ped-9-Data manipulation: Time Series & Geographical visualization
Aaa ped-9-Data manipulation: Time Series & Geographical visualizationAaa ped-9-Data manipulation: Time Series & Geographical visualization
Aaa ped-9-Data manipulation: Time Series & Geographical visualization
 

Similar to Reactive programming at scale

Optimization of Continuous Queries in Federated Database and Stream Processin...
Optimization of Continuous Queries in Federated Database and Stream Processin...Optimization of Continuous Queries in Federated Database and Stream Processin...
Optimization of Continuous Queries in Federated Database and Stream Processin...
Zbigniew Jerzak
 
Super COMPUTING Journal
Super COMPUTING JournalSuper COMPUTING Journal
Super COMPUTING Journal
Pandey_G
 
Approximate Dynamic Programming: A New Paradigm for Process Control & Optimiz...
Approximate Dynamic Programming: A New Paradigm for Process Control & Optimiz...Approximate Dynamic Programming: A New Paradigm for Process Control & Optimiz...
Approximate Dynamic Programming: A New Paradigm for Process Control & Optimiz...
height
 

Similar to Reactive programming at scale (20)

Optimization of Continuous Queries in Federated Database and Stream Processin...
Optimization of Continuous Queries in Federated Database and Stream Processin...Optimization of Continuous Queries in Federated Database and Stream Processin...
Optimization of Continuous Queries in Federated Database and Stream Processin...
 
Make streaming processing towards ANSI SQL
Make streaming processing towards ANSI SQLMake streaming processing towards ANSI SQL
Make streaming processing towards ANSI SQL
 
Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...
Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...
Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...
 
DOWNSAMPLING DATA
DOWNSAMPLING DATADOWNSAMPLING DATA
DOWNSAMPLING DATA
 
ScyllaDB V Developer Deep Dive Series: Resiliency and Strong Consistency via ...
ScyllaDB V Developer Deep Dive Series: Resiliency and Strong Consistency via ...ScyllaDB V Developer Deep Dive Series: Resiliency and Strong Consistency via ...
ScyllaDB V Developer Deep Dive Series: Resiliency and Strong Consistency via ...
 
BDW16 London - William Vambenepe, Google - 3rd Generation Data Platform
BDW16 London - William Vambenepe, Google - 3rd Generation Data PlatformBDW16 London - William Vambenepe, Google - 3rd Generation Data Platform
BDW16 London - William Vambenepe, Google - 3rd Generation Data Platform
 
Assessing the Impacts of Uncertainty Propagation to System Requirements by Ev...
Assessing the Impacts of Uncertainty Propagation to System Requirements by Ev...Assessing the Impacts of Uncertainty Propagation to System Requirements by Ev...
Assessing the Impacts of Uncertainty Propagation to System Requirements by Ev...
 
Super COMPUTING Journal
Super COMPUTING JournalSuper COMPUTING Journal
Super COMPUTING Journal
 
Approximate Dynamic Programming: A New Paradigm for Process Control & Optimiz...
Approximate Dynamic Programming: A New Paradigm for Process Control & Optimiz...Approximate Dynamic Programming: A New Paradigm for Process Control & Optimiz...
Approximate Dynamic Programming: A New Paradigm for Process Control & Optimiz...
 
Dataflows: The abstraction that powers Big Data by Raul Castro Fernandez at ...
 Dataflows: The abstraction that powers Big Data by Raul Castro Fernandez at ... Dataflows: The abstraction that powers Big Data by Raul Castro Fernandez at ...
Dataflows: The abstraction that powers Big Data by Raul Castro Fernandez at ...
 
apidays LIVE Paris - Sopra Steria: path to the industrialization of sustaina...
 apidays LIVE Paris - Sopra Steria: path to the industrialization of sustaina... apidays LIVE Paris - Sopra Steria: path to the industrialization of sustaina...
apidays LIVE Paris - Sopra Steria: path to the industrialization of sustaina...
 
Static Energy Prediction in Software: A Worst-Case Scenario Approach
Static Energy Prediction in Software: A Worst-Case Scenario ApproachStatic Energy Prediction in Software: A Worst-Case Scenario Approach
Static Energy Prediction in Software: A Worst-Case Scenario Approach
 
Flink Forward Berlin 2018: Raj Subramani - "A streaming Quantitative Analytic...
Flink Forward Berlin 2018: Raj Subramani - "A streaming Quantitative Analytic...Flink Forward Berlin 2018: Raj Subramani - "A streaming Quantitative Analytic...
Flink Forward Berlin 2018: Raj Subramani - "A streaming Quantitative Analytic...
 
Strata Singapore: Gearpump Real time DAG-Processing with Akka at Scale
Strata Singapore: GearpumpReal time DAG-Processing with Akka at ScaleStrata Singapore: GearpumpReal time DAG-Processing with Akka at Scale
Strata Singapore: Gearpump Real time DAG-Processing with Akka at Scale
 
Automated Program Repair, Distinguished lecture at MPI-SWS
Automated Program Repair, Distinguished lecture at MPI-SWSAutomated Program Repair, Distinguished lecture at MPI-SWS
Automated Program Repair, Distinguished lecture at MPI-SWS
 
Holistic data application quality
Holistic data application qualityHolistic data application quality
Holistic data application quality
 
Computer Science Projects in Scilab
Computer Science Projects in ScilabComputer Science Projects in Scilab
Computer Science Projects in Scilab
 
Second Level Cache in JPA Explained
Second Level Cache in JPA ExplainedSecond Level Cache in JPA Explained
Second Level Cache in JPA Explained
 
Utilizing FME as an API Test Framework
Utilizing FME as an API Test Framework Utilizing FME as an API Test Framework
Utilizing FME as an API Test Framework
 
Ch1
Ch1Ch1
Ch1
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Reactive programming at scale