SlideShare a Scribd company logo
1 of 42
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Summary and implementation of a process
calculi for long running transactions
Alex Prut1
1Universit`a degli Studi di Udine
Dipartimento di Scienze Matematiche, Informatiche e Fisiche
Concurrency Theory, 15 July 2016
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Presentation based on the work I
R. Bruni. G. Ferrari. H. Melgratti. U. Montanari.
From Theory to Practice in Transactional Composition
of Web Services.
2005
R. Bruni. H. Melgratti. U. Montanari.
Theoretical Foundations for Compensations in Flow
Services Composition Languages.
2005
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Outline
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional Web Services
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Web Services (WS)
Choreography
Orchestration
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
ACID
Atomicity: requires that each transaction be ”all or
nothing”
Consistency: ensures that any transaction will bring the
database from one valid state to another
Isolation : ensures that the concurrent execution of
transactions results in a system state that would be
obtained if transactions were executed serially
Durability : ensures that once a transaction has been
committed, it will remain so, even in the event of power
loss
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Long-running transactions (LRTs)
Long-running transactions: (also known as Saga) are
computer database transactions that avoid locks on
non-local resources, use compensation to handle failures
a LRT is a saga if it can be written as a sequence of
transactions that can be interleaved with other
transactions
relax Isolation property, keep strong Atomicity,
Consistency, Durability properties
use compensations
Hector Garcia-Molina Kenneth Salem.
Sagas.
1987
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Transactions with compensation
A1 ÷ B1; A2 ÷ B2; A3 ÷ B3
success : A1; A2; A3
failure with success (undo activities) : A1; A2; B1
forward flow : A1; A2; A3
backward flow: B3; B2; B1
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Problem
varie linguaggi per l’orchestrazione di WS (XLANG,
BPML, ...): purtroppo forniscono una sintassi formale e
non una semantica formale
poca attenzione: Join calculus, πt-calculus, ...
Sagas Calculus: perch`e astrae dal basso livello di
computazione e communicazione e si focalizza sulla
struttura composizionale ad alto livello di processi
transazionali
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Goals
Provide a formal framework for isolating and studying
LRTs (Sagas Calculus, Naive Sagas)
Provide a framework for implementing a WS scenario
(JTWS)
R. Bruni. G. Ferrari. H. Melgratti. U. Montanari.
From Theory to Practice in Transactional Composition
of Web Services.
2005
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Goals and Introduction
fornire una semantica per un insieme di linguaggi
transazionali generici con espressivit`a aumentante
inizialmente una formalizzazione di un linguaggio per la
composizione di attivit`a atomiche in sequenza
successivamente estendere il linguaggio e fornire una
semantica per la composizione di attivit`a atomiche in
parallelo
discussione di varie alternative e future possibili
estensioni
R. Bruni. H. Melgratti. U. Montanari.
Theoretical Foundations for Compensations in Flow
Services Composition Languages.
2005
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Outline
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional Web Services
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Sequential Sagas
an infinite set A of names for atomic activities, ranged
over by A, B...
nil activity 0 ∈ A that always completes and has no
effect
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Sequential Sagas
Structural congruence
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Big Step Semantics
R = { , , } the set of possible results for the
execution of a saga, ∈ R
for commit
for abort (compensated)
for abnormal termination
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Big Step Semantics
Context / Scenario
we are not interested on the low level behaviour of
individual tasks, we rely on the abstract description of
their execution, stating wheter they complete
successfully or abort
This information is given by a context Γ
Γ : A → { , } is a partial function over A
we denote a particular function Γ as
A1 → 1, · · · , An → n where Ai = Aj for all i = j
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Big Step Semantics
Γ S →α denotes that the execution of S produces
when the atomic activities behave like Γ
the observation flow α describes the actual flow
Γ P, β →α , β describes the behavior of a
process P within a saga that already installed the
compensation β
Figure: Semantics of sequential sagas: inference rules
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Sequential Sagas
Adequacy Theorem
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Outline
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional Web Services
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Parallel Sagas
the language of sequential sagas is extended with the
operator |
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Parallel Sagas
Naive Semantics of parallel composition
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Parallel Sagas
Example
S ≡ {A1 ÷ B1; A2 ÷ B2|C1 ÷ D1}
Γ = A1 → , A2 → , C1 → , B1 → , B2 →
α = (A1; A2|0); B2; B1
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Outline
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional Web Services
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Naive Sagas: Syntax
build over a set of atomic activities Σ ∪ {0, THROW },
ranged over A, B...
0 is the nil activity
THROWS is the interrupting activity
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Naive Sagas: Semantics
Semantics is defined in terms of admissible execution
traces
a trace for a saga is a string s ω , where s ∈ Σ∗ is said
the observable flow and ω ∈ Ω is the final event
Ω = { , !, ?} ( stands for success, ! for failure, ? for
yielding to a concurrent interrupt)
hereafter, we let p, q, r range over Σ∗ and s, t range
over the set of traces Σ∗Ω
The set of traces is evaluated according to a scenario
Γ : Σ → { , !}
Γ S = S if S and S represent the same set of traces
under the scenario Γ
Γ s ∈ S ifthe set of traces associated to S under the
scenario Γ includes s
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Naive Sagas: Semantics
Composition of Standard Traces
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Naive Sagas: Semantics
Traces of Naive Sagas
(p ω , s) where p ω is the forward trace and s is the
corresponding compensation trace
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Naive Sagas: Semantics
Composition of Compensable Traces
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Naive Sagas: Semantics
Traces of Compensable Processes
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Example
Handling Purchase Orders
HPOsaga = [A.O. ÷ R.O.; (U.C. ÷ R.M.|P.O. ÷ U.S.)]
Γ HPOsaga =
{ A.O., U.C., P.O., , A.O., P.O., U.C., }
Γ HPOsaga = { A.O., P.O., U.S., R.O., }
Γ2 HPOsaga = { A.O., P.O., ! }
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Naive Sagas: Equivalences
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Outline
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional Web Services
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Java Transactional Web Services (JTWS)
A Java implementation on Naive Sagas
Java Transactional Web Services (JTWS) = Java Signal
Core Layer (JSCL) + Java Transactional Layer (JTS)
Java Signal Code Layer: fornisce delle primitive per la
gestione dei segnali
Java Transactional Layer: definisce le primitive per le
transazioni
WS becomes JTWS components by exchaning signals
Publish / Subscribe pattern
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Java Signal Core Layer (JSCL)
Provide primitive mechanisms for defining and
exchanging signals among gates
Signal: an event that occurs on a given gate
Handlers: must subscribe to a signal
Emitters: generate signals
Signal class: (defines signals, carry some internal
information) (getParam, setParamValue, id)
Communication by means of I/O ports
Ports connectec through links
e.createLink(t, h), h = handler, t = type of the link, e
= emitter
e.emitSignal
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Gates
JTWS components are called gates
comp(A, B)
API class: AtomicTask
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Java Transactional Layer (JTL)
specialisation of JSCL focused on describing the
transactional aspects related to the forward and
backward flow across gates
Signals: Forward, Commit, Rollback, Exception
API Classes: TransactionalSequence,
TransactionalParallel, TransactionalComponent
(onForward, onCommit, onException, onRollback
methods)
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Mapping Naive sagas in JTWS
1) Signals representing the states of the transaction
2) atomic tasks represent atomic activities of Naive
Sagas
3) transactional generic gates corresponding to sagas
Exception signal implement !
Rollaback, Commit implements
NB: we assume that signal emission do not fail
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Gates for sequential composition of sagas
seq(P, Q)
A, B atomic tasks
A starts execution when a Forward signal is received on
in port
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
GenericTransactionalGate class
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Gates for parallel composition of sagas
par(P, Q)
use Collector, Trigger as auxiliary gates
3 scenario: (Commit, Rollback, Exception)
closure(P)
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Naive Sagas to JTWS mapping
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Complete Example
[RecSMS ÷ SMSErr; LocUser; SearchTC; MakeCall]
Summary and
implementation of
a process calculi
for long running
transactions
Alex Prut
Introduction
Background
Sagas Calculus
Sequential Sagas
Parallel Sagas
Naive Sagas
Implementation
Java Transactional
Web Services
Summary
Summary
a visual/graphical representation of parallel sagas
a process calculus description in bijective
correspondence with sagas diagrams
an executable, distributed translation of symbolic
processes
Future work: implement nested transactions and other
features

More Related Content

Similar to Summary and implementation of a process calculi for long running transactions

No More, No Less: A Formal Model for Serverless Computing
No More, No Less: A Formal Model for Serverless ComputingNo More, No Less: A Formal Model for Serverless Computing
No More, No Less: A Formal Model for Serverless Computing
Marco Peressotti
 
Asynchronous Mobile Web Services:
Asynchronous Mobile Web Services: Asynchronous Mobile Web Services:
Asynchronous Mobile Web Services:
Dr. Fahad Aijaz
 
Sidang proposal english
Sidang proposal   englishSidang proposal   english
Sidang proposal english
Anang Khunaefi
 
Spring 5 Project Reactor
Spring 5 Project ReactorSpring 5 Project Reactor
Spring 5 Project Reactor
Geoffrey Filippi
 

Similar to Summary and implementation of a process calculi for long running transactions (20)

No More, No Less: A Formal Model for Serverless Computing
No More, No Less: A Formal Model for Serverless ComputingNo More, No Less: A Formal Model for Serverless Computing
No More, No Less: A Formal Model for Serverless Computing
 
Linear Regression
Linear RegressionLinear Regression
Linear Regression
 
Event mesh APIDays melbourne September 2019
Event mesh APIDays melbourne September 2019Event mesh APIDays melbourne September 2019
Event mesh APIDays melbourne September 2019
 
LCA13: Android Infrastructure Automation Improvements
LCA13: Android Infrastructure Automation ImprovementsLCA13: Android Infrastructure Automation Improvements
LCA13: Android Infrastructure Automation Improvements
 
Experiences with Oracle WebCenter 11g: Implementing SOA with a User Interface
Experiences with Oracle WebCenter 11g: Implementing SOA with a User InterfaceExperiences with Oracle WebCenter 11g: Implementing SOA with a User Interface
Experiences with Oracle WebCenter 11g: Implementing SOA with a User Interface
 
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
 
Donabe-essex-conference-readout
Donabe-essex-conference-readoutDonabe-essex-conference-readout
Donabe-essex-conference-readout
 
Data Streaming Technology Overview
Data Streaming Technology OverviewData Streaming Technology Overview
Data Streaming Technology Overview
 
Reactive IoT, Java One 2016
Reactive IoT, Java One 2016Reactive IoT, Java One 2016
Reactive IoT, Java One 2016
 
DZone_RC_RxJS
DZone_RC_RxJSDZone_RC_RxJS
DZone_RC_RxJS
 
Building a Utilities Portal with Magnolia 5 & SAP
Building a Utilities Portal with Magnolia 5 & SAPBuilding a Utilities Portal with Magnolia 5 & SAP
Building a Utilities Portal with Magnolia 5 & SAP
 
Evolution of netflix conductor
Evolution of netflix conductorEvolution of netflix conductor
Evolution of netflix conductor
 
Asynchronous Mobile Web Services:
Asynchronous Mobile Web Services: Asynchronous Mobile Web Services:
Asynchronous Mobile Web Services:
 
Sidang proposal english
Sidang proposal   englishSidang proposal   english
Sidang proposal english
 
Azure Durable Functions
Azure Durable FunctionsAzure Durable Functions
Azure Durable Functions
 
Asynchronyin net
Asynchronyin netAsynchronyin net
Asynchronyin net
 
Spring 5 Project Reactor
Spring 5 Project ReactorSpring 5 Project Reactor
Spring 5 Project Reactor
 
Using state-engine-as-sca-component-final
Using state-engine-as-sca-component-finalUsing state-engine-as-sca-component-final
Using state-engine-as-sca-component-final
 
Airavata_Architecture_xsede16
Airavata_Architecture_xsede16Airavata_Architecture_xsede16
Airavata_Architecture_xsede16
 
Scala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streamsScala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streams
 

Recently uploaded

Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
FIDO Alliance
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
Muhammad Subhan
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 

Recently uploaded (20)

WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهله
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 

Summary and implementation of a process calculi for long running transactions

  • 1. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Summary and implementation of a process calculi for long running transactions Alex Prut1 1Universit`a degli Studi di Udine Dipartimento di Scienze Matematiche, Informatiche e Fisiche Concurrency Theory, 15 July 2016
  • 2. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Presentation based on the work I R. Bruni. G. Ferrari. H. Melgratti. U. Montanari. From Theory to Practice in Transactional Composition of Web Services. 2005 R. Bruni. H. Melgratti. U. Montanari. Theoretical Foundations for Compensations in Flow Services Composition Languages. 2005
  • 3. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Outline Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services
  • 4. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Web Services (WS) Choreography Orchestration
  • 5. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary ACID Atomicity: requires that each transaction be ”all or nothing” Consistency: ensures that any transaction will bring the database from one valid state to another Isolation : ensures that the concurrent execution of transactions results in a system state that would be obtained if transactions were executed serially Durability : ensures that once a transaction has been committed, it will remain so, even in the event of power loss
  • 6. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Long-running transactions (LRTs) Long-running transactions: (also known as Saga) are computer database transactions that avoid locks on non-local resources, use compensation to handle failures a LRT is a saga if it can be written as a sequence of transactions that can be interleaved with other transactions relax Isolation property, keep strong Atomicity, Consistency, Durability properties use compensations Hector Garcia-Molina Kenneth Salem. Sagas. 1987
  • 7. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Transactions with compensation A1 ÷ B1; A2 ÷ B2; A3 ÷ B3 success : A1; A2; A3 failure with success (undo activities) : A1; A2; B1 forward flow : A1; A2; A3 backward flow: B3; B2; B1
  • 8. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Problem varie linguaggi per l’orchestrazione di WS (XLANG, BPML, ...): purtroppo forniscono una sintassi formale e non una semantica formale poca attenzione: Join calculus, πt-calculus, ... Sagas Calculus: perch`e astrae dal basso livello di computazione e communicazione e si focalizza sulla struttura composizionale ad alto livello di processi transazionali
  • 9. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Goals Provide a formal framework for isolating and studying LRTs (Sagas Calculus, Naive Sagas) Provide a framework for implementing a WS scenario (JTWS) R. Bruni. G. Ferrari. H. Melgratti. U. Montanari. From Theory to Practice in Transactional Composition of Web Services. 2005
  • 10. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Goals and Introduction fornire una semantica per un insieme di linguaggi transazionali generici con espressivit`a aumentante inizialmente una formalizzazione di un linguaggio per la composizione di attivit`a atomiche in sequenza successivamente estendere il linguaggio e fornire una semantica per la composizione di attivit`a atomiche in parallelo discussione di varie alternative e future possibili estensioni R. Bruni. H. Melgratti. U. Montanari. Theoretical Foundations for Compensations in Flow Services Composition Languages. 2005
  • 11. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Outline Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services
  • 12. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Sequential Sagas an infinite set A of names for atomic activities, ranged over by A, B... nil activity 0 ∈ A that always completes and has no effect
  • 13. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Sequential Sagas Structural congruence
  • 14. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Big Step Semantics R = { , , } the set of possible results for the execution of a saga, ∈ R for commit for abort (compensated) for abnormal termination
  • 15. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Big Step Semantics Context / Scenario we are not interested on the low level behaviour of individual tasks, we rely on the abstract description of their execution, stating wheter they complete successfully or abort This information is given by a context Γ Γ : A → { , } is a partial function over A we denote a particular function Γ as A1 → 1, · · · , An → n where Ai = Aj for all i = j
  • 16. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Big Step Semantics Γ S →α denotes that the execution of S produces when the atomic activities behave like Γ the observation flow α describes the actual flow Γ P, β →α , β describes the behavior of a process P within a saga that already installed the compensation β Figure: Semantics of sequential sagas: inference rules
  • 17. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Sequential Sagas Adequacy Theorem
  • 18. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Outline Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services
  • 19. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Parallel Sagas the language of sequential sagas is extended with the operator |
  • 20. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Parallel Sagas Naive Semantics of parallel composition
  • 21. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Parallel Sagas Example S ≡ {A1 ÷ B1; A2 ÷ B2|C1 ÷ D1} Γ = A1 → , A2 → , C1 → , B1 → , B2 → α = (A1; A2|0); B2; B1
  • 22. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Outline Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services
  • 23. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Naive Sagas: Syntax build over a set of atomic activities Σ ∪ {0, THROW }, ranged over A, B... 0 is the nil activity THROWS is the interrupting activity
  • 24. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Naive Sagas: Semantics Semantics is defined in terms of admissible execution traces a trace for a saga is a string s ω , where s ∈ Σ∗ is said the observable flow and ω ∈ Ω is the final event Ω = { , !, ?} ( stands for success, ! for failure, ? for yielding to a concurrent interrupt) hereafter, we let p, q, r range over Σ∗ and s, t range over the set of traces Σ∗Ω The set of traces is evaluated according to a scenario Γ : Σ → { , !} Γ S = S if S and S represent the same set of traces under the scenario Γ Γ s ∈ S ifthe set of traces associated to S under the scenario Γ includes s
  • 25. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Naive Sagas: Semantics Composition of Standard Traces
  • 26. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Naive Sagas: Semantics Traces of Naive Sagas (p ω , s) where p ω is the forward trace and s is the corresponding compensation trace
  • 27. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Naive Sagas: Semantics Composition of Compensable Traces
  • 28. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Naive Sagas: Semantics Traces of Compensable Processes
  • 29. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Example Handling Purchase Orders HPOsaga = [A.O. ÷ R.O.; (U.C. ÷ R.M.|P.O. ÷ U.S.)] Γ HPOsaga = { A.O., U.C., P.O., , A.O., P.O., U.C., } Γ HPOsaga = { A.O., P.O., U.S., R.O., } Γ2 HPOsaga = { A.O., P.O., ! }
  • 30. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Naive Sagas: Equivalences
  • 31. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Outline Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services
  • 32. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Java Transactional Web Services (JTWS) A Java implementation on Naive Sagas Java Transactional Web Services (JTWS) = Java Signal Core Layer (JSCL) + Java Transactional Layer (JTS) Java Signal Code Layer: fornisce delle primitive per la gestione dei segnali Java Transactional Layer: definisce le primitive per le transazioni WS becomes JTWS components by exchaning signals Publish / Subscribe pattern
  • 33. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Java Signal Core Layer (JSCL) Provide primitive mechanisms for defining and exchanging signals among gates Signal: an event that occurs on a given gate Handlers: must subscribe to a signal Emitters: generate signals Signal class: (defines signals, carry some internal information) (getParam, setParamValue, id) Communication by means of I/O ports Ports connectec through links e.createLink(t, h), h = handler, t = type of the link, e = emitter e.emitSignal
  • 34. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Gates JTWS components are called gates comp(A, B) API class: AtomicTask
  • 35. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Java Transactional Layer (JTL) specialisation of JSCL focused on describing the transactional aspects related to the forward and backward flow across gates Signals: Forward, Commit, Rollback, Exception API Classes: TransactionalSequence, TransactionalParallel, TransactionalComponent (onForward, onCommit, onException, onRollback methods)
  • 36. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Mapping Naive sagas in JTWS 1) Signals representing the states of the transaction 2) atomic tasks represent atomic activities of Naive Sagas 3) transactional generic gates corresponding to sagas Exception signal implement ! Rollaback, Commit implements NB: we assume that signal emission do not fail
  • 37. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Gates for sequential composition of sagas seq(P, Q) A, B atomic tasks A starts execution when a Forward signal is received on in port
  • 38. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary GenericTransactionalGate class
  • 39. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Gates for parallel composition of sagas par(P, Q) use Collector, Trigger as auxiliary gates 3 scenario: (Commit, Rollback, Exception) closure(P)
  • 40. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Naive Sagas to JTWS mapping
  • 41. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Complete Example [RecSMS ÷ SMSErr; LocUser; SearchTC; MakeCall]
  • 42. Summary and implementation of a process calculi for long running transactions Alex Prut Introduction Background Sagas Calculus Sequential Sagas Parallel Sagas Naive Sagas Implementation Java Transactional Web Services Summary Summary a visual/graphical representation of parallel sagas a process calculus description in bijective correspondence with sagas diagrams an executable, distributed translation of symbolic processes Future work: implement nested transactions and other features