SlideShare une entreprise Scribd logo
1  sur  30
We Have a DREAM
Distributed Reactive Programming
with Consistency Guarantees
A. Margara
USI
Lugano
G. Salvaneschi
Technische Universitat
Darmstadt
DREAM
• DREAM: a middleware for distributed reactive
programming
• Reactive programming is a novel
programming model that simplifies the
development of reactive systems
– Systems that react to changes in the external
environment
Reactive Systems
GUI
Monitoring / Control
System
Event-Based Programming
boolean highTemp;
boolean smoke;
void onTempReading(TempEvent e ) {
highTemp = e.getValue() > 45;
if (highTemp && smoke) {
alert.start();
}
}
void onSmokeReading(SmokeEvent e) {
smoke = e.getIntensity() > 0.5;
if (highTemp && smoke) {
alert.start();
}
}
Callback
functions
Callback
functions
StateState
Control
statements
Control
statements
Reactive Programming
alarm.active :=
detector.intensity > 0.5 && sensor.temp > 45;
detector.intensity sensor.temp
alarm.active
Observable
variables
Observable
variables
Reactive
variables
Reactive
variables
Expression /
constraint
Expression /
constraint
Reactive Programming
Reactive Programming
• Data dependencies are explicit in the code
– Code is more compact
– Code is easier to read and understand
• The runtime is responsible for propagating
changes and updating variables
– Takes care of ensuring the correctness of the
propagation
– With respect to some consistency guarantees
Consistency Guarantees
• Depending on the propagation strategy
– D could be updated with a new value of B and an
old value of C
• Temporary inconsistency  glitch
AA
B = f(A)B = f(A)
C = g(A)C = g(A)
D = h(B, C)D = h(B, C)
Consistency Guarantees
• Depending on the propagation strategy
– B and C could see updates from A and A’ in
different orders
• Violation of the atomicity of propagation
AA
B = f(A, A’)B = f(A, A’)
C = g(A, A’)C = g(A, A’)
A’A’
Existing Work
• RP has been studied in centralized scenarios
– Several systems include propagation strategies
that ensure glitch-freedom
• Distributed RP received little attention
– E.g., no system provides glitch-freedom/atomicity
in distributed settings
DREAM
• DREAM – Distributed REActive Middleware
– Offers distributed RP in Java
– Relies on a decentralized event-based middleware
– Three levels of consistency guarantees
• Causal
– Exactly once, FIFO and causal ordered delivery of updates
• Glitch free
• Atomic
DREAM: API
Abstract class
Observable methods
(used in expressions that
define reactive variables)
DREAM: API
DREAM: Implementation
Watcher
B
B
B
B
B
B
R
c
c
c
c
c
c
c
c
c
c
cc
CommunicationManager
Reactive
Object
Observable
Object
Subscribe
Notify Advertise/Notify
Acyclic
network of
brokers
Acyclic
network of
brokers
Client
Library
Client
Library
DREAM: Implementation
• Observable object
creation
– An advertisement is
flooded to all the
brokers in the network
Watcher
B
B
B
B
B
B
R
c
c
c
c
c
c
c
c
c
c
cc
CommunicationManager
Reactive
Object
Observable
Object
Subscribe
Notify Advertise/Notify
DREAM: Implementation
• Reactive object creation
– One subscription for
each observable OB
appearing in the
expression
– Follows the reverse path
of the advertisement up
to the client in charge
for OB
Watcher
B
B
B
B
B
B
R
c
c
c
c
c
c
c
c
c
c
cc
CommunicationManager
Reactive
Object
Observable
Object
Subscribe
Notify Advertise/Notify
DREAM: Implementation
• Observable object (OB)
update
– An update event is
propagated
– Matched and filtered at
each broker …
– … to reach only
interested reactive
objects
• Defined starting from OB
Watcher
B
B
B
B
B
B
R
c
c
c
c
c
c
c
c
c
c
cc
CommunicationManager
Reactive
Object
Observable
Object
Subscribe
Notify Advertise/Notify
Consistency Guarantees
• Causal semantics
• Glitch-free semantics
• Atomic semantics
Causal Semantics
• Node-to-node communication preserves
ordering
• Processing preserves ordering
• In absence of failures DREAM provides
– Exactly once delivery
– FIFO order of updates
• It can be demonstrated that
– Acyclic network + FIFO order = causal order
Glitch-Freedom
• Brokers keep track of the dependency graph
• In case of a potential glitch
– They compute the set of updates a client should wait
for
– They attach this information to the update events
AA
B = f(A)B = f(A)
C = f(A)C = f(A)
D = f(B, C)D = f(B, C)
Wait for C!
Wait for B!
Atomic Semantics
• Only one propagation is allowed at any point in time
• Before starting a propagation a broker requests a
token to a special TGS
– Requests get queued in the TGS
– A new token is granted only when the previous
propagation is completed
AA
B = f(A, A’)B = f(A, A’)
C = f(A, A’)C = f(A, A’)
A’A’
Evaluation
• Goal
– Comparison of consistency guarantees
– Under different scenarios
• Metrics
– Updates propagation delay
– Network traffic
Default Scenario
Number of Brokers 10
Number of Clients 50
Number of Intermediate Brokers 50%
Link Latency 1-5ms
Number of Reactive Graphs 10
Depth of Reactive Graphs 5
Size of Reactive Expressions 2
Degree of Locality in Reactive Expressions 80%
Frequency of Changes per Observable 1 change/s
Advantages of Distribution
Delay (ms) Traffic (KB/s)
Central. Distrib. Central. Distrib.
Causal 4.77 4.76 68.3 69.8
Glitch-Free 29.53 17.18 205.4 130.9
Atomic 53.41 26.75 265.5 161.3
Locality of Expressions
Delay Traffic
Spurious Notifications
AA
B = f(A)B = f(A)
C = g(A)C = g(A)
D = h(B, C)D = h(B, C) …
Size of Reactive Graph
Delay Traffic
Conclusions
• First system providing
– Distributed reactive programming
– With flexible consistency guarantees
• Study of benefits/cost
• Try it!
– www.inf.usi.ch/postdoc/margara
(Current and) Future Work
• Adoption in mobile scenarios
– Porting to Android
– Definition of protocols to deal with (temporary) disconnections
• Improved expressiveness
– Integration with the language
• Static type-checking of expressions
– More types of observable/reactive objects
• Collections
– Complex expressions
• Parameters, guards, historical values
• Improved performance
– On-demand (pull-based) evaluation of reactive expressions
www.inf.usi.ch/postdoc/margara

Contenu connexe

Tendances

Analysis and Design of PID controller with control parameters in MATLAB and S...
Analysis and Design of PID controller with control parameters in MATLAB and S...Analysis and Design of PID controller with control parameters in MATLAB and S...
Analysis and Design of PID controller with control parameters in MATLAB and S...MIbrar4
 
One function ( Timer ) in SecuoNEO Project
One function ( Timer ) in SecuoNEO ProjectOne function ( Timer ) in SecuoNEO Project
One function ( Timer ) in SecuoNEO ProjectNay Oo Kyaw
 
Mobicents Media Server theory, practice, cloud considerations, design discuss...
Mobicents Media Server theory, practice, cloud considerations, design discuss...Mobicents Media Server theory, practice, cloud considerations, design discuss...
Mobicents Media Server theory, practice, cloud considerations, design discuss...telestax
 
Season 4 [Free OpManager training] Part4 - Network fault management & IT auto...
Season 4 [Free OpManager training] Part4 - Network fault management & IT auto...Season 4 [Free OpManager training] Part4 - Network fault management & IT auto...
Season 4 [Free OpManager training] Part4 - Network fault management & IT auto...ManageEngine, Zoho Corporation
 
Comparing Cpp And Erlang For Motorola Telecoms Software
Comparing Cpp And Erlang For Motorola Telecoms SoftwareComparing Cpp And Erlang For Motorola Telecoms Software
Comparing Cpp And Erlang For Motorola Telecoms Softwarel xf
 
Performance measures
Performance measuresPerformance measures
Performance measuresDivya Tiwari
 
Visual Verifications through Liveness Analysis using Mobile Devices
Visual Verifications through Liveness Analysis using Mobile DevicesVisual Verifications through Liveness Analysis using Mobile Devices
Visual Verifications through Liveness Analysis using Mobile DevicesMahmudur Rahman
 
2018867974 sulaim (2)
2018867974 sulaim (2)2018867974 sulaim (2)
2018867974 sulaim (2)sulaim_qais
 
Application of the automation know-how within the EGS-CC project
Application of the automation know-how within the EGS-CC projectApplication of the automation know-how within the EGS-CC project
Application of the automation know-how within the EGS-CC projectNieves Salor
 
ECET 365 Success Begins/Newtonhelp.com
ECET 365 Success Begins/Newtonhelp.comECET 365 Success Begins/Newtonhelp.com
ECET 365 Success Begins/Newtonhelp.comledlang1
 
Compiler Optimization-Space Exploration
Compiler Optimization-Space ExplorationCompiler Optimization-Space Exploration
Compiler Optimization-Space Explorationtmusabbir
 
Smpant Transact09
Smpant Transact09Smpant Transact09
Smpant Transact09smpant
 
ECET 365 Success Begins /newtonhelp.com 
ECET 365 Success Begins /newtonhelp.com ECET 365 Success Begins /newtonhelp.com 
ECET 365 Success Begins /newtonhelp.com myblue134
 
Halsted’s Software Science-An analytical technique
Halsted’s Software Science-An analytical techniqueHalsted’s Software Science-An analytical technique
Halsted’s Software Science-An analytical techniqueNur Islam
 

Tendances (20)

Update on Benchmark 7
Update on Benchmark 7Update on Benchmark 7
Update on Benchmark 7
 
Analysis and Design of PID controller with control parameters in MATLAB and S...
Analysis and Design of PID controller with control parameters in MATLAB and S...Analysis and Design of PID controller with control parameters in MATLAB and S...
Analysis and Design of PID controller with control parameters in MATLAB and S...
 
One function ( Timer ) in SecuoNEO Project
One function ( Timer ) in SecuoNEO ProjectOne function ( Timer ) in SecuoNEO Project
One function ( Timer ) in SecuoNEO Project
 
Mobicents Media Server theory, practice, cloud considerations, design discuss...
Mobicents Media Server theory, practice, cloud considerations, design discuss...Mobicents Media Server theory, practice, cloud considerations, design discuss...
Mobicents Media Server theory, practice, cloud considerations, design discuss...
 
Season 4 [Free OpManager training] Part4 - Network fault management & IT auto...
Season 4 [Free OpManager training] Part4 - Network fault management & IT auto...Season 4 [Free OpManager training] Part4 - Network fault management & IT auto...
Season 4 [Free OpManager training] Part4 - Network fault management & IT auto...
 
Chris brown ti
Chris brown tiChris brown ti
Chris brown ti
 
Comparing Cpp And Erlang For Motorola Telecoms Software
Comparing Cpp And Erlang For Motorola Telecoms SoftwareComparing Cpp And Erlang For Motorola Telecoms Software
Comparing Cpp And Erlang For Motorola Telecoms Software
 
Performance measures
Performance measuresPerformance measures
Performance measures
 
Visual Verifications through Liveness Analysis using Mobile Devices
Visual Verifications through Liveness Analysis using Mobile DevicesVisual Verifications through Liveness Analysis using Mobile Devices
Visual Verifications through Liveness Analysis using Mobile Devices
 
2018867974 sulaim (2)
2018867974 sulaim (2)2018867974 sulaim (2)
2018867974 sulaim (2)
 
Verification strategies
Verification strategiesVerification strategies
Verification strategies
 
Application of the automation know-how within the EGS-CC project
Application of the automation know-how within the EGS-CC projectApplication of the automation know-how within the EGS-CC project
Application of the automation know-how within the EGS-CC project
 
ECET 365 Success Begins/Newtonhelp.com
ECET 365 Success Begins/Newtonhelp.comECET 365 Success Begins/Newtonhelp.com
ECET 365 Success Begins/Newtonhelp.com
 
Compiler Optimization-Space Exploration
Compiler Optimization-Space ExplorationCompiler Optimization-Space Exploration
Compiler Optimization-Space Exploration
 
Code optimization
Code optimizationCode optimization
Code optimization
 
Smpant Transact09
Smpant Transact09Smpant Transact09
Smpant Transact09
 
Lecture 20
Lecture 20Lecture 20
Lecture 20
 
Kalman filter
Kalman filterKalman filter
Kalman filter
 
ECET 365 Success Begins /newtonhelp.com 
ECET 365 Success Begins /newtonhelp.com ECET 365 Success Begins /newtonhelp.com 
ECET 365 Success Begins /newtonhelp.com 
 
Halsted’s Software Science-An analytical technique
Halsted’s Software Science-An analytical techniqueHalsted’s Software Science-An analytical technique
Halsted’s Software Science-An analytical technique
 

Similaire à We have a DREAM: Distributed Reactive Programming with Consistency Guarantees - DEBS 2014

Reactive solutions using java 9 and spring reactor
Reactive solutions using java 9 and spring reactorReactive solutions using java 9 and spring reactor
Reactive solutions using java 9 and spring reactorOrenEzer1
 
Actionable Insights with Apache Apex at Apache Big Data 2017 by Devendra Tagare
Actionable Insights with Apache Apex at Apache Big Data 2017 by Devendra TagareActionable Insights with Apache Apex at Apache Big Data 2017 by Devendra Tagare
Actionable Insights with Apache Apex at Apache Big Data 2017 by Devendra TagareApache Apex
 
Reactive Java: Promises and Streams with Reakt (JavaOne talk 2016)
Reactive Java: Promises and Streams with Reakt  (JavaOne talk 2016)Reactive Java: Promises and Streams with Reakt  (JavaOne talk 2016)
Reactive Java: Promises and Streams with Reakt (JavaOne talk 2016)Rick Hightower
 
Reactive Java: Promises and Streams with Reakt (JavaOne Talk 2016)
Reactive Java:  Promises and Streams with Reakt (JavaOne Talk 2016)Reactive Java:  Promises and Streams with Reakt (JavaOne Talk 2016)
Reactive Java: Promises and Streams with Reakt (JavaOne Talk 2016)Rick Hightower
 
Springone2gx 2014 Reactive Streams and Reactor
Springone2gx 2014 Reactive Streams and ReactorSpringone2gx 2014 Reactive Streams and Reactor
Springone2gx 2014 Reactive Streams and ReactorStéphane Maldini
 
Continuous Performance Testing
Continuous Performance TestingContinuous Performance Testing
Continuous Performance TestingC4Media
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examplesPeter Lawrey
 
Reactive Programming in Java and Spring Framework 5
Reactive Programming in Java and Spring Framework 5Reactive Programming in Java and Spring Framework 5
Reactive Programming in Java and Spring Framework 5Richard Langlois P. Eng.
 
Reactive Streams, Linking Reactive Application To Spark Streaming
Reactive Streams, Linking Reactive Application To Spark StreamingReactive Streams, Linking Reactive Application To Spark Streaming
Reactive Streams, Linking Reactive Application To Spark StreamingSpark Summit
 
Adding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsAdding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsRonny López
 
Reactive Streams, linking Reactive Application to Spark Streaming by Luc Bour...
Reactive Streams, linking Reactive Application to Spark Streaming by Luc Bour...Reactive Streams, linking Reactive Application to Spark Streaming by Luc Bour...
Reactive Streams, linking Reactive Application to Spark Streaming by Luc Bour...Spark Summit
 
AWS Loft Talk: Behind the Scenes with SignalFx
AWS Loft Talk: Behind the Scenes with SignalFxAWS Loft Talk: Behind the Scenes with SignalFx
AWS Loft Talk: Behind the Scenes with SignalFxSignalFx
 
Making Custom Oscilloscope Measurements
Making Custom Oscilloscope MeasurementsMaking Custom Oscilloscope Measurements
Making Custom Oscilloscope Measurementsteledynelecroy
 
10 implementing subprograms
10 implementing subprograms10 implementing subprograms
10 implementing subprogramsMunawar Ahmed
 
OpenStack-Based NFV Cloud at Swisscom: challenges and best practices
OpenStack-Based NFV Cloud at Swisscom: challenges and best practicesOpenStack-Based NFV Cloud at Swisscom: challenges and best practices
OpenStack-Based NFV Cloud at Swisscom: challenges and best practicesAvi Networks
 

Similaire à We have a DREAM: Distributed Reactive Programming with Consistency Guarantees - DEBS 2014 (20)

Reactors.io
Reactors.ioReactors.io
Reactors.io
 
Reactive solutions using java 9 and spring reactor
Reactive solutions using java 9 and spring reactorReactive solutions using java 9 and spring reactor
Reactive solutions using java 9 and spring reactor
 
Actionable Insights with Apache Apex at Apache Big Data 2017 by Devendra Tagare
Actionable Insights with Apache Apex at Apache Big Data 2017 by Devendra TagareActionable Insights with Apache Apex at Apache Big Data 2017 by Devendra Tagare
Actionable Insights with Apache Apex at Apache Big Data 2017 by Devendra Tagare
 
Reactive Java: Promises and Streams with Reakt (JavaOne talk 2016)
Reactive Java: Promises and Streams with Reakt  (JavaOne talk 2016)Reactive Java: Promises and Streams with Reakt  (JavaOne talk 2016)
Reactive Java: Promises and Streams with Reakt (JavaOne talk 2016)
 
Reactive Java: Promises and Streams with Reakt (JavaOne Talk 2016)
Reactive Java:  Promises and Streams with Reakt (JavaOne Talk 2016)Reactive Java:  Promises and Streams with Reakt (JavaOne Talk 2016)
Reactive Java: Promises and Streams with Reakt (JavaOne Talk 2016)
 
Springone2gx 2014 Reactive Streams and Reactor
Springone2gx 2014 Reactive Streams and ReactorSpringone2gx 2014 Reactive Streams and Reactor
Springone2gx 2014 Reactive Streams and Reactor
 
Continuous Performance Testing
Continuous Performance TestingContinuous Performance Testing
Continuous Performance Testing
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examples
 
Reactive Programming in Java and Spring Framework 5
Reactive Programming in Java and Spring Framework 5Reactive Programming in Java and Spring Framework 5
Reactive Programming in Java and Spring Framework 5
 
Reactive Streams, Linking Reactive Application To Spark Streaming
Reactive Streams, Linking Reactive Application To Spark StreamingReactive Streams, Linking Reactive Application To Spark Streaming
Reactive Streams, Linking Reactive Application To Spark Streaming
 
Adding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsAdding Real-time Features to PHP Applications
Adding Real-time Features to PHP Applications
 
Reactive Streams, linking Reactive Application to Spark Streaming by Luc Bour...
Reactive Streams, linking Reactive Application to Spark Streaming by Luc Bour...Reactive Streams, linking Reactive Application to Spark Streaming by Luc Bour...
Reactive Streams, linking Reactive Application to Spark Streaming by Luc Bour...
 
AWS Loft Talk: Behind the Scenes with SignalFx
AWS Loft Talk: Behind the Scenes with SignalFxAWS Loft Talk: Behind the Scenes with SignalFx
AWS Loft Talk: Behind the Scenes with SignalFx
 
Reactive mesh
Reactive meshReactive mesh
Reactive mesh
 
Wireless LAN Design Fundamentals in the Campus
Wireless LAN Design Fundamentals in the CampusWireless LAN Design Fundamentals in the Campus
Wireless LAN Design Fundamentals in the Campus
 
Making Custom Oscilloscope Measurements
Making Custom Oscilloscope MeasurementsMaking Custom Oscilloscope Measurements
Making Custom Oscilloscope Measurements
 
Dill may-2008
Dill may-2008Dill may-2008
Dill may-2008
 
10 implementing subprograms
10 implementing subprograms10 implementing subprograms
10 implementing subprograms
 
Istio presentation jhug
Istio presentation jhugIstio presentation jhug
Istio presentation jhug
 
OpenStack-Based NFV Cloud at Swisscom: challenges and best practices
OpenStack-Based NFV Cloud at Swisscom: challenges and best practicesOpenStack-Based NFV Cloud at Swisscom: challenges and best practices
OpenStack-Based NFV Cloud at Swisscom: challenges and best practices
 

Dernier

Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfmaor17
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 

Dernier (20)

Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 

We have a DREAM: Distributed Reactive Programming with Consistency Guarantees - DEBS 2014

  • 1. We Have a DREAM Distributed Reactive Programming with Consistency Guarantees A. Margara USI Lugano G. Salvaneschi Technische Universitat Darmstadt
  • 2. DREAM • DREAM: a middleware for distributed reactive programming • Reactive programming is a novel programming model that simplifies the development of reactive systems – Systems that react to changes in the external environment
  • 4. Event-Based Programming boolean highTemp; boolean smoke; void onTempReading(TempEvent e ) { highTemp = e.getValue() > 45; if (highTemp && smoke) { alert.start(); } } void onSmokeReading(SmokeEvent e) { smoke = e.getIntensity() > 0.5; if (highTemp && smoke) { alert.start(); } } Callback functions Callback functions StateState Control statements Control statements
  • 5. Reactive Programming alarm.active := detector.intensity > 0.5 && sensor.temp > 45; detector.intensity sensor.temp alarm.active Observable variables Observable variables Reactive variables Reactive variables Expression / constraint Expression / constraint
  • 7. Reactive Programming • Data dependencies are explicit in the code – Code is more compact – Code is easier to read and understand • The runtime is responsible for propagating changes and updating variables – Takes care of ensuring the correctness of the propagation – With respect to some consistency guarantees
  • 8. Consistency Guarantees • Depending on the propagation strategy – D could be updated with a new value of B and an old value of C • Temporary inconsistency  glitch AA B = f(A)B = f(A) C = g(A)C = g(A) D = h(B, C)D = h(B, C)
  • 9. Consistency Guarantees • Depending on the propagation strategy – B and C could see updates from A and A’ in different orders • Violation of the atomicity of propagation AA B = f(A, A’)B = f(A, A’) C = g(A, A’)C = g(A, A’) A’A’
  • 10. Existing Work • RP has been studied in centralized scenarios – Several systems include propagation strategies that ensure glitch-freedom • Distributed RP received little attention – E.g., no system provides glitch-freedom/atomicity in distributed settings
  • 11. DREAM • DREAM – Distributed REActive Middleware – Offers distributed RP in Java – Relies on a decentralized event-based middleware – Three levels of consistency guarantees • Causal – Exactly once, FIFO and causal ordered delivery of updates • Glitch free • Atomic
  • 12. DREAM: API Abstract class Observable methods (used in expressions that define reactive variables)
  • 15. DREAM: Implementation • Observable object creation – An advertisement is flooded to all the brokers in the network Watcher B B B B B B R c c c c c c c c c c cc CommunicationManager Reactive Object Observable Object Subscribe Notify Advertise/Notify
  • 16. DREAM: Implementation • Reactive object creation – One subscription for each observable OB appearing in the expression – Follows the reverse path of the advertisement up to the client in charge for OB Watcher B B B B B B R c c c c c c c c c c cc CommunicationManager Reactive Object Observable Object Subscribe Notify Advertise/Notify
  • 17. DREAM: Implementation • Observable object (OB) update – An update event is propagated – Matched and filtered at each broker … – … to reach only interested reactive objects • Defined starting from OB Watcher B B B B B B R c c c c c c c c c c cc CommunicationManager Reactive Object Observable Object Subscribe Notify Advertise/Notify
  • 18. Consistency Guarantees • Causal semantics • Glitch-free semantics • Atomic semantics
  • 19. Causal Semantics • Node-to-node communication preserves ordering • Processing preserves ordering • In absence of failures DREAM provides – Exactly once delivery – FIFO order of updates • It can be demonstrated that – Acyclic network + FIFO order = causal order
  • 20. Glitch-Freedom • Brokers keep track of the dependency graph • In case of a potential glitch – They compute the set of updates a client should wait for – They attach this information to the update events AA B = f(A)B = f(A) C = f(A)C = f(A) D = f(B, C)D = f(B, C) Wait for C! Wait for B!
  • 21. Atomic Semantics • Only one propagation is allowed at any point in time • Before starting a propagation a broker requests a token to a special TGS – Requests get queued in the TGS – A new token is granted only when the previous propagation is completed AA B = f(A, A’)B = f(A, A’) C = f(A, A’)C = f(A, A’) A’A’
  • 22. Evaluation • Goal – Comparison of consistency guarantees – Under different scenarios • Metrics – Updates propagation delay – Network traffic
  • 23. Default Scenario Number of Brokers 10 Number of Clients 50 Number of Intermediate Brokers 50% Link Latency 1-5ms Number of Reactive Graphs 10 Depth of Reactive Graphs 5 Size of Reactive Expressions 2 Degree of Locality in Reactive Expressions 80% Frequency of Changes per Observable 1 change/s
  • 24. Advantages of Distribution Delay (ms) Traffic (KB/s) Central. Distrib. Central. Distrib. Causal 4.77 4.76 68.3 69.8 Glitch-Free 29.53 17.18 205.4 130.9 Atomic 53.41 26.75 265.5 161.3
  • 26. Spurious Notifications AA B = f(A)B = f(A) C = g(A)C = g(A) D = h(B, C)D = h(B, C) …
  • 27. Size of Reactive Graph Delay Traffic
  • 28. Conclusions • First system providing – Distributed reactive programming – With flexible consistency guarantees • Study of benefits/cost • Try it! – www.inf.usi.ch/postdoc/margara
  • 29. (Current and) Future Work • Adoption in mobile scenarios – Porting to Android – Definition of protocols to deal with (temporary) disconnections • Improved expressiveness – Integration with the language • Static type-checking of expressions – More types of observable/reactive objects • Collections – Complex expressions • Parameters, guards, historical values • Improved performance – On-demand (pull-based) evaluation of reactive expressions

Notes de l'éditeur

  1. Examples of reactive systems are GUI, in which the system receives an input from the user, processes it, and reacts to it, by applying some changes to the interface. Similarly, in monitoring and control system, a processing module receives events from the external environment (e.g., sensor readings) and reacts to them (e.g., triggering an alarm in case of danger).
  2. Need to define variables to keep state information Variables can be modified in several callback methods (easy to loose data dependency information) Check and control statement in several code locations (e.g., activate / deactivate the alert)
  3. You can set the visibility to LOCAL Or to GLOBAL You can use remote observable to define new reactive objects You can call normal methods or register a listener for a specific method You can define observable reactive
  4. Causal allows local processing of local events (no need to contact brokers to check for glitch-freedom violations) Much lower delat and traffic Atomic requires additional communication with a granting service to ensure atomicity of propagation Significant differences in delay and traffic when moving from centralized to distributed, especially for protocols that need to communicate with the broker network
  5. Both delay and traffic decrease with the locality of expression. Traffic goes to 0 with the causal consistency protocol (no need to communicate) Interestingly, with a limited locality, the causal consistency protocol produces MORE traffic. This is because of the propagation of spurious updates.