SlideShare une entreprise Scribd logo
1  sur  22
Télécharger pour lire hors ligne
Compensating Service Transactions 
SOA Patterns Webinar Series 
09/30/2014 
Nuwan Bandara, Senior Lead Engineer 
Nipun Suwandaratna, Senior Engineer
Agenda 
o Transactions - basic overview 
o Rollback Mechanism 
o Long Running Processes 
o What is Compensation 
o Compensations methods 
o Try-Confirm Cancel (TCC) Model 
o Compensations with BPEL 
o TCC with WSO2 ESB 
o Demo
Transactions 
What are Transactions ? 
An action or a series of coordinated actions performed to fulfil a 
business functionality (business Transaction) 
Service B 
Service C 
Service D 
Service A
Stateful and Stateless Transactions 
and processes 
o Stateless transactions do not track or maintain a record of the 
occurred events 
o Stateful transactions keep track of the current state of the 
interaction. This information could be in memory or persisted 
to a storage such as DB or File 
o A Process could be either short transient or long running, and 
made up of a collection of stateful and/or stateless 
transactions
Error Situation 
What if something Goes Wrong ? 
Can we always Rollback the Process?
Rollback situation 
๏Item purchase over an ecommerce site
Rollback Mechanism 
o Services are atomic units that provide a clearly defined business 
functionality – A service is responsible for handling errors when it is 
invoked. But it’s not the job of a service to make sure the integrity of the 
overall process (that would make the system tightly coupled) 
o When services are grouped to form a process (composite service) the 
Transaction Coordinator has to handle the undo operations when errors 
occur. 
o ACID transactions ensure integrity. 
o Not practical in Long Running Processes since resources are blocked for a 
long time 
o More memory/resource consuming since all services need to preserve 
their original states till a commit or rollback is notified
Long Running Processes 
o Services are atomic units that provide a clearly defined business 
functionality – A service is responsible for handling errors when it is 
invoked. But it’s not the job of a service to make sure the integrity of 
the overall process (that would make the system tightly coupled) 
o A process that is suspended upon external input 
o Inputs could be triggered by some event or by human interaction 
o May be made up of a series of transactions
Long Running Process Example 
Travel Booking Service Scenario 
Book Hotel 
Book Air Ticket 
Book Taxi 
Travel 
Booking 
Service
Travel Booking Service - Sequence
What is Compensation 
Compensation is the process of restoring a system to it’s original 
state upon the occurrence of an error or a situation where the 
business transaction could not successfully proceed any further.
When is Compensation Needed 
o In situations where multiple services that are not make up a 
single transaction and the business process as a whole is not 
ACID 
o That is, a rollback of the current transaction/service does not 
help to restore the integrity of the overall business 
transaction. 
o In Long-Running processes 
*
Compensation as a regular Transaction 
o This is when the compensation is performed as a regular 
transaction 
E.g: In a stock trading scenario 
If a stock broker buys 5000 stocks of company A for the price 
of $2.00 each by mistake the only way to compensate for it is 
to sell the same for $2.00 each (or more) 
But stock prices cannot be guaranteed
Using Undo Operations 
o Each service should provide a fault operation 
o Synchronous services – No issues, service returns fault 
o Asynchronous – Mechanism should be in place for the caller to 
wait for the response from the service 
*
Undo Operations in the Travel Booking System 
Taxi Booking Service 
-Book Taxi 
-Cancel Booking 
Hotel Booking Service 
-Book Hotel Room 
-Cancel Booking 
Travel 
Booking 
Service 
Airline Booking Service 
-Book Ticket 
-Cancel Booking
Cons of Undo Operations 
o Air Line is at a risk of loss if the 
reservation is cancelled 
o Hotel is at a risk of loss if booking is 
cancelled 
o Taxi service is at a loss if the taxi 
booking is cancelled 
o Customer or Travel Agent is at a risk of 
loss if any of the above systems denies 
cancellation or does not refund full 
amount 
o Someone is at the risk of losing money 
if the resources that are reserved are 
revenue generating resources
The TRY-CONFIRM/CANCEL Model 
o TRY Operation – Reserves Airline Seat, but the booking is not 
complete 
o CONFIRM – Confirms the bookings if all other requirements 
are fulfilled 
o IF other requirements are not fulfilled send a CANCEL 
request
Characteristics of the TRY-CONFIRM/CANCEL 
Model 
o Each request remains tentative until it’s Confirmed or 
Cancelled 
o Cancellation timeouts will be set by service provider 
o Aggregates XA based (2PC) and Compensating transaction 
models 
o Uses a coordinating service 
o Uses Http Verbs (POST, PUT) to carry out the transaction
Advantages of the TRY-CONFIRM/CANCEL 
Model 
o Leads to a loosely coupled transaction model 
o Eliminates the need to have a compensating service for all 
the forward actions 
o Decouples Error handling 
o Increases Autonomy
Compensation with BPEL 
o Driven by partner links 
o Each invocation has a compensation
TCC With WSO2 ESB
Thank You !!

Contenu connexe

En vedette

Cloud Design Patterns
Cloud Design PatternsCloud Design Patterns
Cloud Design PatternsTaswar Bhatti
 
Cloud Design Patterns - PRESCRIPTIVE ARCHITECTURE GUIDANCE FOR CLOUD APPLICAT...
Cloud Design Patterns - PRESCRIPTIVE ARCHITECTURE GUIDANCE FOR CLOUD APPLICAT...Cloud Design Patterns - PRESCRIPTIVE ARCHITECTURE GUIDANCE FOR CLOUD APPLICAT...
Cloud Design Patterns - PRESCRIPTIVE ARCHITECTURE GUIDANCE FOR CLOUD APPLICAT...David J Rosenthal
 
Terracotta Ehcache : Simpler, faster, distributed
Terracotta Ehcache : Simpler, faster, distributedTerracotta Ehcache : Simpler, faster, distributed
Terracotta Ehcache : Simpler, faster, distributedAnthony Dahanne
 
Cloud Design Pattern part1
Cloud Design Pattern part1Cloud Design Pattern part1
Cloud Design Pattern part1Masashi Narumoto
 
Stuff About CQRS
Stuff About CQRSStuff About CQRS
Stuff About CQRSthinkddd
 
Cloud patterns at Carleton University
Cloud patterns at Carleton UniversityCloud patterns at Carleton University
Cloud patterns at Carleton UniversityTaswar Bhatti
 
Circuit Breaker Pattern
Circuit Breaker PatternCircuit Breaker Pattern
Circuit Breaker PatternVikash Kodati
 

En vedette (7)

Cloud Design Patterns
Cloud Design PatternsCloud Design Patterns
Cloud Design Patterns
 
Cloud Design Patterns - PRESCRIPTIVE ARCHITECTURE GUIDANCE FOR CLOUD APPLICAT...
Cloud Design Patterns - PRESCRIPTIVE ARCHITECTURE GUIDANCE FOR CLOUD APPLICAT...Cloud Design Patterns - PRESCRIPTIVE ARCHITECTURE GUIDANCE FOR CLOUD APPLICAT...
Cloud Design Patterns - PRESCRIPTIVE ARCHITECTURE GUIDANCE FOR CLOUD APPLICAT...
 
Terracotta Ehcache : Simpler, faster, distributed
Terracotta Ehcache : Simpler, faster, distributedTerracotta Ehcache : Simpler, faster, distributed
Terracotta Ehcache : Simpler, faster, distributed
 
Cloud Design Pattern part1
Cloud Design Pattern part1Cloud Design Pattern part1
Cloud Design Pattern part1
 
Stuff About CQRS
Stuff About CQRSStuff About CQRS
Stuff About CQRS
 
Cloud patterns at Carleton University
Cloud patterns at Carleton UniversityCloud patterns at Carleton University
Cloud patterns at Carleton University
 
Circuit Breaker Pattern
Circuit Breaker PatternCircuit Breaker Pattern
Circuit Breaker Pattern
 

Similaire à Compensating Service Transactions

Order To Cash for Services Business
Order To Cash for Services BusinessOrder To Cash for Services Business
Order To Cash for Services BusinessNaresh Lamba
 
WebXpress Cash Management Solution
WebXpress Cash Management SolutionWebXpress Cash Management Solution
WebXpress Cash Management SolutionWebXpress.IN
 
GST compliance : TMS - Transport Management System | Logistics ERP
GST compliance : TMS - Transport Management System | Logistics ERPGST compliance : TMS - Transport Management System | Logistics ERP
GST compliance : TMS - Transport Management System | Logistics ERPcargo365cloud
 
Chapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency controlChapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency controlAbDul ThaYyal
 
Lecture 15 - Technical Details
Lecture 15 - Technical DetailsLecture 15 - Technical Details
Lecture 15 - Technical Detailsphanleson
 
A framework for streamlining globally integrated services
A framework for streamlining globally integrated servicesA framework for streamlining globally integrated services
A framework for streamlining globally integrated servicesAli Elkhateb
 
Unit iv -Transactions
Unit iv -TransactionsUnit iv -Transactions
Unit iv -TransactionsDhivyaa C.R
 
How to Develop your own in App-Purchase Service in Odoo
How to Develop your own in App-Purchase Service in OdooHow to Develop your own in App-Purchase Service in Odoo
How to Develop your own in App-Purchase Service in OdooOdoo
 
Paratransit Service Analytics Reporting
Paratransit Service Analytics ReportingParatransit Service Analytics Reporting
Paratransit Service Analytics ReportingTSSParatransit
 
Distributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit ProtocolsDistributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit ProtocolsSachin Chauhan
 

Similaire à Compensating Service Transactions (20)

MIS
MISMIS
MIS
 
Regional Airlines - telephone reservation system analysis
Regional Airlines - telephone reservation system analysisRegional Airlines - telephone reservation system analysis
Regional Airlines - telephone reservation system analysis
 
Order To Cash for Services Business
Order To Cash for Services BusinessOrder To Cash for Services Business
Order To Cash for Services Business
 
WebXpress Cash Management Solution
WebXpress Cash Management SolutionWebXpress Cash Management Solution
WebXpress Cash Management Solution
 
Rainmaker Crew Pay
Rainmaker Crew PayRainmaker Crew Pay
Rainmaker Crew Pay
 
09 workflow
09 workflow09 workflow
09 workflow
 
GST compliance : TMS - Transport Management System | Logistics ERP
GST compliance : TMS - Transport Management System | Logistics ERPGST compliance : TMS - Transport Management System | Logistics ERP
GST compliance : TMS - Transport Management System | Logistics ERP
 
Chapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency controlChapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency control
 
Managing transactions 11g release 1 (10.3
Managing transactions   11g release 1 (10.3Managing transactions   11g release 1 (10.3
Managing transactions 11g release 1 (10.3
 
Lecture 15 - Technical Details
Lecture 15 - Technical DetailsLecture 15 - Technical Details
Lecture 15 - Technical Details
 
A framework for streamlining globally integrated services
A framework for streamlining globally integrated servicesA framework for streamlining globally integrated services
A framework for streamlining globally integrated services
 
Network Operations Center Processes- Isaac Mwesigwa
Network Operations Center Processes- Isaac MwesigwaNetwork Operations Center Processes- Isaac Mwesigwa
Network Operations Center Processes- Isaac Mwesigwa
 
Unit iv -Transactions
Unit iv -TransactionsUnit iv -Transactions
Unit iv -Transactions
 
Deepak Shukla V2
Deepak Shukla V2Deepak Shukla V2
Deepak Shukla V2
 
Acid properties
Acid propertiesAcid properties
Acid properties
 
11 bpm
11 bpm11 bpm
11 bpm
 
How to Develop your own in App-Purchase Service in Odoo
How to Develop your own in App-Purchase Service in OdooHow to Develop your own in App-Purchase Service in Odoo
How to Develop your own in App-Purchase Service in Odoo
 
TekWave SBMM Software (service company)
TekWave SBMM Software (service company)TekWave SBMM Software (service company)
TekWave SBMM Software (service company)
 
Paratransit Service Analytics Reporting
Paratransit Service Analytics ReportingParatransit Service Analytics Reporting
Paratransit Service Analytics Reporting
 
Distributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit ProtocolsDistributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit Protocols
 

Plus de WSO2

Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
How to Create a Service in Choreo
How to Create a Service in ChoreoHow to Create a Service in Choreo
How to Create a Service in ChoreoWSO2
 
Ballerina Tech Talk - May 2023
Ballerina Tech Talk - May 2023Ballerina Tech Talk - May 2023
Ballerina Tech Talk - May 2023WSO2
 
Platform Strategy to Deliver Digital Experiences on Azure
Platform Strategy to Deliver Digital Experiences on AzurePlatform Strategy to Deliver Digital Experiences on Azure
Platform Strategy to Deliver Digital Experiences on AzureWSO2
 
GartnerITSymSessionSlides.pdf
GartnerITSymSessionSlides.pdfGartnerITSymSessionSlides.pdf
GartnerITSymSessionSlides.pdfWSO2
 
[Webinar] How to Create an API in Minutes
[Webinar] How to Create an API in Minutes[Webinar] How to Create an API in Minutes
[Webinar] How to Create an API in MinutesWSO2
 
Modernizing the Student Journey with Ethos Identity
Modernizing the Student Journey with Ethos IdentityModernizing the Student Journey with Ethos Identity
Modernizing the Student Journey with Ethos IdentityWSO2
 
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...WSO2
 
CIO Summit Berlin 2022.pptx.pdf
CIO Summit Berlin 2022.pptx.pdfCIO Summit Berlin 2022.pptx.pdf
CIO Summit Berlin 2022.pptx.pdfWSO2
 
Delivering New Digital Experiences Fast - Introducing Choreo
Delivering New Digital Experiences Fast - Introducing ChoreoDelivering New Digital Experiences Fast - Introducing Choreo
Delivering New Digital Experiences Fast - Introducing ChoreoWSO2
 
Fueling the Digital Experience Economy with Connected Products
Fueling the Digital Experience Economy with Connected ProductsFueling the Digital Experience Economy with Connected Products
Fueling the Digital Experience Economy with Connected ProductsWSO2
 
A Reference Methodology for Agile Digital Businesses
 A Reference Methodology for Agile Digital Businesses A Reference Methodology for Agile Digital Businesses
A Reference Methodology for Agile Digital BusinessesWSO2
 
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)WSO2
 
Lessons from the pandemic - From a single use case to true transformation
 Lessons from the pandemic - From a single use case to true transformation Lessons from the pandemic - From a single use case to true transformation
Lessons from the pandemic - From a single use case to true transformationWSO2
 
Adding Liveliness to Banking Experiences
Adding Liveliness to Banking ExperiencesAdding Liveliness to Banking Experiences
Adding Liveliness to Banking ExperiencesWSO2
 
Building a Future-ready Bank
Building a Future-ready BankBuilding a Future-ready Bank
Building a Future-ready BankWSO2
 
WSO2 API Manager Community Call - November 2021
WSO2 API Manager Community Call - November 2021WSO2 API Manager Community Call - November 2021
WSO2 API Manager Community Call - November 2021WSO2
 
[API World ] - Managing Asynchronous APIs
[API World ] - Managing Asynchronous APIs[API World ] - Managing Asynchronous APIs
[API World ] - Managing Asynchronous APIsWSO2
 
[API World 2021 ] - Understanding Cloud Native Deployment
[API World 2021 ] - Understanding Cloud Native Deployment[API World 2021 ] - Understanding Cloud Native Deployment
[API World 2021 ] - Understanding Cloud Native DeploymentWSO2
 
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”WSO2
 

Plus de WSO2 (20)

Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
How to Create a Service in Choreo
How to Create a Service in ChoreoHow to Create a Service in Choreo
How to Create a Service in Choreo
 
Ballerina Tech Talk - May 2023
Ballerina Tech Talk - May 2023Ballerina Tech Talk - May 2023
Ballerina Tech Talk - May 2023
 
Platform Strategy to Deliver Digital Experiences on Azure
Platform Strategy to Deliver Digital Experiences on AzurePlatform Strategy to Deliver Digital Experiences on Azure
Platform Strategy to Deliver Digital Experiences on Azure
 
GartnerITSymSessionSlides.pdf
GartnerITSymSessionSlides.pdfGartnerITSymSessionSlides.pdf
GartnerITSymSessionSlides.pdf
 
[Webinar] How to Create an API in Minutes
[Webinar] How to Create an API in Minutes[Webinar] How to Create an API in Minutes
[Webinar] How to Create an API in Minutes
 
Modernizing the Student Journey with Ethos Identity
Modernizing the Student Journey with Ethos IdentityModernizing the Student Journey with Ethos Identity
Modernizing the Student Journey with Ethos Identity
 
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...
Choreo - Build unique digital experiences on WSO2's platform, secured by Etho...
 
CIO Summit Berlin 2022.pptx.pdf
CIO Summit Berlin 2022.pptx.pdfCIO Summit Berlin 2022.pptx.pdf
CIO Summit Berlin 2022.pptx.pdf
 
Delivering New Digital Experiences Fast - Introducing Choreo
Delivering New Digital Experiences Fast - Introducing ChoreoDelivering New Digital Experiences Fast - Introducing Choreo
Delivering New Digital Experiences Fast - Introducing Choreo
 
Fueling the Digital Experience Economy with Connected Products
Fueling the Digital Experience Economy with Connected ProductsFueling the Digital Experience Economy with Connected Products
Fueling the Digital Experience Economy with Connected Products
 
A Reference Methodology for Agile Digital Businesses
 A Reference Methodology for Agile Digital Businesses A Reference Methodology for Agile Digital Businesses
A Reference Methodology for Agile Digital Businesses
 
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
 
Lessons from the pandemic - From a single use case to true transformation
 Lessons from the pandemic - From a single use case to true transformation Lessons from the pandemic - From a single use case to true transformation
Lessons from the pandemic - From a single use case to true transformation
 
Adding Liveliness to Banking Experiences
Adding Liveliness to Banking ExperiencesAdding Liveliness to Banking Experiences
Adding Liveliness to Banking Experiences
 
Building a Future-ready Bank
Building a Future-ready BankBuilding a Future-ready Bank
Building a Future-ready Bank
 
WSO2 API Manager Community Call - November 2021
WSO2 API Manager Community Call - November 2021WSO2 API Manager Community Call - November 2021
WSO2 API Manager Community Call - November 2021
 
[API World ] - Managing Asynchronous APIs
[API World ] - Managing Asynchronous APIs[API World ] - Managing Asynchronous APIs
[API World ] - Managing Asynchronous APIs
 
[API World 2021 ] - Understanding Cloud Native Deployment
[API World 2021 ] - Understanding Cloud Native Deployment[API World 2021 ] - Understanding Cloud Native Deployment
[API World 2021 ] - Understanding Cloud Native Deployment
 
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
 

Dernier

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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 RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
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 MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
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...Igalia
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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 slidevu2urc
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Dernier (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Compensating Service Transactions

  • 1. Compensating Service Transactions SOA Patterns Webinar Series 09/30/2014 Nuwan Bandara, Senior Lead Engineer Nipun Suwandaratna, Senior Engineer
  • 2. Agenda o Transactions - basic overview o Rollback Mechanism o Long Running Processes o What is Compensation o Compensations methods o Try-Confirm Cancel (TCC) Model o Compensations with BPEL o TCC with WSO2 ESB o Demo
  • 3. Transactions What are Transactions ? An action or a series of coordinated actions performed to fulfil a business functionality (business Transaction) Service B Service C Service D Service A
  • 4. Stateful and Stateless Transactions and processes o Stateless transactions do not track or maintain a record of the occurred events o Stateful transactions keep track of the current state of the interaction. This information could be in memory or persisted to a storage such as DB or File o A Process could be either short transient or long running, and made up of a collection of stateful and/or stateless transactions
  • 5. Error Situation What if something Goes Wrong ? Can we always Rollback the Process?
  • 6. Rollback situation ๏Item purchase over an ecommerce site
  • 7. Rollback Mechanism o Services are atomic units that provide a clearly defined business functionality – A service is responsible for handling errors when it is invoked. But it’s not the job of a service to make sure the integrity of the overall process (that would make the system tightly coupled) o When services are grouped to form a process (composite service) the Transaction Coordinator has to handle the undo operations when errors occur. o ACID transactions ensure integrity. o Not practical in Long Running Processes since resources are blocked for a long time o More memory/resource consuming since all services need to preserve their original states till a commit or rollback is notified
  • 8. Long Running Processes o Services are atomic units that provide a clearly defined business functionality – A service is responsible for handling errors when it is invoked. But it’s not the job of a service to make sure the integrity of the overall process (that would make the system tightly coupled) o A process that is suspended upon external input o Inputs could be triggered by some event or by human interaction o May be made up of a series of transactions
  • 9. Long Running Process Example Travel Booking Service Scenario Book Hotel Book Air Ticket Book Taxi Travel Booking Service
  • 11. What is Compensation Compensation is the process of restoring a system to it’s original state upon the occurrence of an error or a situation where the business transaction could not successfully proceed any further.
  • 12. When is Compensation Needed o In situations where multiple services that are not make up a single transaction and the business process as a whole is not ACID o That is, a rollback of the current transaction/service does not help to restore the integrity of the overall business transaction. o In Long-Running processes *
  • 13. Compensation as a regular Transaction o This is when the compensation is performed as a regular transaction E.g: In a stock trading scenario If a stock broker buys 5000 stocks of company A for the price of $2.00 each by mistake the only way to compensate for it is to sell the same for $2.00 each (or more) But stock prices cannot be guaranteed
  • 14. Using Undo Operations o Each service should provide a fault operation o Synchronous services – No issues, service returns fault o Asynchronous – Mechanism should be in place for the caller to wait for the response from the service *
  • 15. Undo Operations in the Travel Booking System Taxi Booking Service -Book Taxi -Cancel Booking Hotel Booking Service -Book Hotel Room -Cancel Booking Travel Booking Service Airline Booking Service -Book Ticket -Cancel Booking
  • 16. Cons of Undo Operations o Air Line is at a risk of loss if the reservation is cancelled o Hotel is at a risk of loss if booking is cancelled o Taxi service is at a loss if the taxi booking is cancelled o Customer or Travel Agent is at a risk of loss if any of the above systems denies cancellation or does not refund full amount o Someone is at the risk of losing money if the resources that are reserved are revenue generating resources
  • 17. The TRY-CONFIRM/CANCEL Model o TRY Operation – Reserves Airline Seat, but the booking is not complete o CONFIRM – Confirms the bookings if all other requirements are fulfilled o IF other requirements are not fulfilled send a CANCEL request
  • 18. Characteristics of the TRY-CONFIRM/CANCEL Model o Each request remains tentative until it’s Confirmed or Cancelled o Cancellation timeouts will be set by service provider o Aggregates XA based (2PC) and Compensating transaction models o Uses a coordinating service o Uses Http Verbs (POST, PUT) to carry out the transaction
  • 19. Advantages of the TRY-CONFIRM/CANCEL Model o Leads to a loosely coupled transaction model o Eliminates the need to have a compensating service for all the forward actions o Decouples Error handling o Increases Autonomy
  • 20. Compensation with BPEL o Driven by partner links o Each invocation has a compensation