Submit Search
Upload
Atomic Transactions for the REST of us
•
21 likes
•
11,769 views
C
Cesare Pautasso
Follow
RESTunconf, Munich, January 2011
Read less
Read more
Technology
Report
Share
Report
Share
1 of 22
Recommended
الفيروسات الكمبيوترية
الفيروسات الكمبيوترية
Ahmed Mohammed Abdel-Halim
[1]اساسيات تفاعل الانسان مع الحاسوب
[1]اساسيات تفاعل الانسان مع الحاسوب
تامنيت نلالوت
الأمن الرقمي للصحفيين
الأمن الرقمي للصحفيين
Mamoun Matar
كتاب البرمجة للصف الخامس - منهاج التكنولوجيا الفلسطيني الجديد
كتاب البرمجة للصف الخامس - منهاج التكنولوجيا الفلسطيني الجديد
Haneen Droubi
Javaメモリ勉強会
Javaメモリ勉強会
Tetsuya Yoshida
Open source Ayaspell Arabic Spell chekcer
Open source Ayaspell Arabic Spell chekcer
linuxscout
хэрэглээний программ хангамж 2
хэрэглээний программ хангамж 2
Dolgormaa Enkhtuvshin
Virtualization
Virtualization
Avni Bindal
Recommended
الفيروسات الكمبيوترية
الفيروسات الكمبيوترية
Ahmed Mohammed Abdel-Halim
[1]اساسيات تفاعل الانسان مع الحاسوب
[1]اساسيات تفاعل الانسان مع الحاسوب
تامنيت نلالوت
الأمن الرقمي للصحفيين
الأمن الرقمي للصحفيين
Mamoun Matar
كتاب البرمجة للصف الخامس - منهاج التكنولوجيا الفلسطيني الجديد
كتاب البرمجة للصف الخامس - منهاج التكنولوجيا الفلسطيني الجديد
Haneen Droubi
Javaメモリ勉強会
Javaメモリ勉強会
Tetsuya Yoshida
Open source Ayaspell Arabic Spell chekcer
Open source Ayaspell Arabic Spell chekcer
linuxscout
хэрэглээний программ хангамж 2
хэрэглээний программ хангамж 2
Dolgormaa Enkhtuvshin
Virtualization
Virtualization
Avni Bindal
Database Systems (SLIDE 1).ppt
Database Systems (SLIDE 1).ppt
NadhirahAhmadKamil1
Pervasive computing
Pervasive computing
Riya Choudhary
Podman
Podman
Yashar Esmaildokht
辞書攻撃をする人は何をどう使っているのか
辞書攻撃をする人は何をどう使っているのか
ozuma5119
مشروع الامن السيبراني
مشروع الامن السيبراني
meshalalmrwani
河野ゼミ研究紹介20211020
河野ゼミ研究紹介20211020
義広 河野
Hot-Spot analysis Using Apache Spark framework
Hot-Spot analysis Using Apache Spark framework
Supriya .
Toolliin sistem
Toolliin sistem
shulam
Active directory
Active directory
Moba Anax
Twitter Finagle
Twitter Finagle
Knoldus Inc.
Anatomy of a web page
Anatomy of a web page
dharvey100
شبكات و أمن المعلومات 2
شبكات و أمن المعلومات 2
emad tawfeek
Hardware virtualization basic
Hardware virtualization basic
Sanoj Kumar
интернэт
интернэт
Baasanjav Enkhee
Application server
Application server
nava rathna
1. introduction to no sql
1. introduction to no sql
Anuja Gunale
Office365導入時のDNS設定の注意点
Office365導入時のDNS設定の注意点
Shu Yamada
MongoDB: システム可用性を拡張するインデクス戦略
MongoDB: システム可用性を拡張するインデクス戦略
ippei_suzuki
Linux Mint
Linux Mint
Nashwan Doaqan
PHP AST 徹底解説
PHP AST 徹底解説
do_aki
Developing “RESTful transactions” with Apache Sling
Developing “RESTful transactions” with Apache Sling
Senol Tas
The New Way of Developing with AEM 6.0 | Sightly | Beautiful Markup
The New Way of Developing with AEM 6.0 | Sightly | Beautiful Markup
Senol Tas
More Related Content
What's hot
Database Systems (SLIDE 1).ppt
Database Systems (SLIDE 1).ppt
NadhirahAhmadKamil1
Pervasive computing
Pervasive computing
Riya Choudhary
Podman
Podman
Yashar Esmaildokht
辞書攻撃をする人は何をどう使っているのか
辞書攻撃をする人は何をどう使っているのか
ozuma5119
مشروع الامن السيبراني
مشروع الامن السيبراني
meshalalmrwani
河野ゼミ研究紹介20211020
河野ゼミ研究紹介20211020
義広 河野
Hot-Spot analysis Using Apache Spark framework
Hot-Spot analysis Using Apache Spark framework
Supriya .
Toolliin sistem
Toolliin sistem
shulam
Active directory
Active directory
Moba Anax
Twitter Finagle
Twitter Finagle
Knoldus Inc.
Anatomy of a web page
Anatomy of a web page
dharvey100
شبكات و أمن المعلومات 2
شبكات و أمن المعلومات 2
emad tawfeek
Hardware virtualization basic
Hardware virtualization basic
Sanoj Kumar
интернэт
интернэт
Baasanjav Enkhee
Application server
Application server
nava rathna
1. introduction to no sql
1. introduction to no sql
Anuja Gunale
Office365導入時のDNS設定の注意点
Office365導入時のDNS設定の注意点
Shu Yamada
MongoDB: システム可用性を拡張するインデクス戦略
MongoDB: システム可用性を拡張するインデクス戦略
ippei_suzuki
Linux Mint
Linux Mint
Nashwan Doaqan
PHP AST 徹底解説
PHP AST 徹底解説
do_aki
What's hot
(20)
Database Systems (SLIDE 1).ppt
Database Systems (SLIDE 1).ppt
Pervasive computing
Pervasive computing
Podman
Podman
辞書攻撃をする人は何をどう使っているのか
辞書攻撃をする人は何をどう使っているのか
مشروع الامن السيبراني
مشروع الامن السيبراني
河野ゼミ研究紹介20211020
河野ゼミ研究紹介20211020
Hot-Spot analysis Using Apache Spark framework
Hot-Spot analysis Using Apache Spark framework
Toolliin sistem
Toolliin sistem
Active directory
Active directory
Twitter Finagle
Twitter Finagle
Anatomy of a web page
Anatomy of a web page
شبكات و أمن المعلومات 2
شبكات و أمن المعلومات 2
Hardware virtualization basic
Hardware virtualization basic
интернэт
интернэт
Application server
Application server
1. introduction to no sql
1. introduction to no sql
Office365導入時のDNS設定の注意点
Office365導入時のDNS設定の注意点
MongoDB: システム可用性を拡張するインデクス戦略
MongoDB: システム可用性を拡張するインデクス戦略
Linux Mint
Linux Mint
PHP AST 徹底解説
PHP AST 徹底解説
Viewers also liked
Developing “RESTful transactions” with Apache Sling
Developing “RESTful transactions” with Apache Sling
Senol Tas
The New Way of Developing with AEM 6.0 | Sightly | Beautiful Markup
The New Way of Developing with AEM 6.0 | Sightly | Beautiful Markup
Senol Tas
Adobe Sneak Peak - Introducing HTL @ Evovle'13
Adobe Sneak Peak - Introducing HTL @ Evovle'13
Senol Tas
Real World REST with Atom/AtomPub
Real World REST with Atom/AtomPub
Peter Keane
Performance monitoring and call tracing in microservice environments
Performance monitoring and call tracing in microservice environments
Martin Gutenbrunner
Security for netflix billing & payments (meetup)
Security for netflix billing & payments (meetup)
Poornaprajna Udupi
3/18/15 Billing&Payments Eng Meetup II - Payments Processing in the Cloud
3/18/15 Billing&Payments Eng Meetup II - Payments Processing in the Cloud
Mathieu Chauvin
Escape From PCI Land
Escape From PCI Land
Rahul Dani
IBM Bluemix Overview
IBM Bluemix Overview
Ian Lynch ☁️
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
Stormpath
Viewers also liked
(10)
Developing “RESTful transactions” with Apache Sling
Developing “RESTful transactions” with Apache Sling
The New Way of Developing with AEM 6.0 | Sightly | Beautiful Markup
The New Way of Developing with AEM 6.0 | Sightly | Beautiful Markup
Adobe Sneak Peak - Introducing HTL @ Evovle'13
Adobe Sneak Peak - Introducing HTL @ Evovle'13
Real World REST with Atom/AtomPub
Real World REST with Atom/AtomPub
Performance monitoring and call tracing in microservice environments
Performance monitoring and call tracing in microservice environments
Security for netflix billing & payments (meetup)
Security for netflix billing & payments (meetup)
3/18/15 Billing&Payments Eng Meetup II - Payments Processing in the Cloud
3/18/15 Billing&Payments Eng Meetup II - Payments Processing in the Cloud
Escape From PCI Land
Escape From PCI Land
IBM Bluemix Overview
IBM Bluemix Overview
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
Similar to Atomic Transactions for the REST of us
BPM with REST
BPM with REST
Cesare Pautasso
RESTful Service Composition with JOpera
RESTful Service Composition with JOpera
Cesare Pautasso
SOA2010 SOA with REST
SOA2010 SOA with REST
Cesare Pautasso
Techniques for Composing REST services - SOA Symposium 2009
Techniques for Composing REST services - SOA Symposium 2009
Cesare Pautasso
SOA with REST
SOA with REST
Cesare Pautasso
Push-Enabling RESTful Business Processes
Push-Enabling RESTful Business Processes
Cesare Pautasso
BPMN for REST
BPMN for REST
Cesare Pautasso
Www2008 Restws Pautasso Talk
Www2008 Restws Pautasso Talk
Kalyan Vijay Kumar Pasumarthi
WS-* vs. RESTful Services
WS-* vs. RESTful Services
Cesare Pautasso
Composing RESTful Services with JOpera
Composing RESTful Services with JOpera
Cesare Pautasso
Composing REST Services
Composing REST Services
elliando dias
REST vs. SOAP
REST vs. SOAP
Murat Çakal
Building+restful+webservice
Building+restful+webservice
lonegunman
Web of Things - Connecting People and Objects on the Web
Web of Things - Connecting People and Objects on the Web
Dominique Guinard
Cesare Pautasso R E S T V1
Cesare Pautasso R E S T V1
SOA Symposium
WebSocket protocol
WebSocket protocol
Kensaku Komatsu
Protecting Multi-Interfaced Mobile Web Services using Agreements
Protecting Multi-Interfaced Mobile Web Services using Agreements
Dr. Fahad Aijaz
Take a REST!
Take a REST!
Vladimir Tsukur
Similar to Atomic Transactions for the REST of us
(18)
BPM with REST
BPM with REST
RESTful Service Composition with JOpera
RESTful Service Composition with JOpera
SOA2010 SOA with REST
SOA2010 SOA with REST
Techniques for Composing REST services - SOA Symposium 2009
Techniques for Composing REST services - SOA Symposium 2009
SOA with REST
SOA with REST
Push-Enabling RESTful Business Processes
Push-Enabling RESTful Business Processes
BPMN for REST
BPMN for REST
Www2008 Restws Pautasso Talk
Www2008 Restws Pautasso Talk
WS-* vs. RESTful Services
WS-* vs. RESTful Services
Composing RESTful Services with JOpera
Composing RESTful Services with JOpera
Composing REST Services
Composing REST Services
REST vs. SOAP
REST vs. SOAP
Building+restful+webservice
Building+restful+webservice
Web of Things - Connecting People and Objects on the Web
Web of Things - Connecting People and Objects on the Web
Cesare Pautasso R E S T V1
Cesare Pautasso R E S T V1
WebSocket protocol
WebSocket protocol
Protecting Multi-Interfaced Mobile Web Services using Agreements
Protecting Multi-Interfaced Mobile Web Services using Agreements
Take a REST!
Take a REST!
More from Cesare Pautasso
Beautiful APIs - SOSE2021 Keynote
Beautiful APIs - SOSE2021 Keynote
Cesare Pautasso
How do you back up and consistently recover your microservice architecture?
How do you back up and consistently recover your microservice architecture?
Cesare Pautasso
Microservices: An Eventually Inconsistent Architectural Style?
Microservices: An Eventually Inconsistent Architectural Style?
Cesare Pautasso
Disaster Recovery and Microservices: The BAC Theorem
Disaster Recovery and Microservices: The BAC Theorem
Cesare Pautasso
The Blockchain as a Software Connector
The Blockchain as a Software Connector
Cesare Pautasso
Team Situational Awareness and Architectural Decision Making with the Softwar...
Team Situational Awareness and Architectural Decision Making with the Softwar...
Cesare Pautasso
JOpera - Eclipse-based Visual Composition Environment featuring a general lan...
JOpera - Eclipse-based Visual Composition Environment featuring a general lan...
Cesare Pautasso
Service Oriented Architectures and Web Services
Service Oriented Architectures and Web Services
Cesare Pautasso
Exploiting Multicores to Optimize Business Process Execution
Exploiting Multicores to Optimize Business Process Execution
Cesare Pautasso
Real-time Mashups di Web Service Geografici
Real-time Mashups di Web Service Geografici
Cesare Pautasso
Towards Scalable Service Composition on Multicores
Towards Scalable Service Composition on Multicores
Cesare Pautasso
USI SCUBE Associate Member
USI SCUBE Associate Member
Cesare Pautasso
Lighweight Collaboration Management (Mashups09@OOPSLA)
Lighweight Collaboration Management (Mashups09@OOPSLA)
Cesare Pautasso
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Cesare Pautasso
Mashups09
Mashups09
Cesare Pautasso
Scientific and Grid Workflow Management (SGS09)
Scientific and Grid Workflow Management (SGS09)
Cesare Pautasso
Composing REST Services
Composing REST Services
Cesare Pautasso
Mashup Ecosystem
Mashup Ecosystem
Cesare Pautasso
Mashup Atelier
Mashup Atelier
Cesare Pautasso
MetaCDN
MetaCDN
Cesare Pautasso
More from Cesare Pautasso
(20)
Beautiful APIs - SOSE2021 Keynote
Beautiful APIs - SOSE2021 Keynote
How do you back up and consistently recover your microservice architecture?
How do you back up and consistently recover your microservice architecture?
Microservices: An Eventually Inconsistent Architectural Style?
Microservices: An Eventually Inconsistent Architectural Style?
Disaster Recovery and Microservices: The BAC Theorem
Disaster Recovery and Microservices: The BAC Theorem
The Blockchain as a Software Connector
The Blockchain as a Software Connector
Team Situational Awareness and Architectural Decision Making with the Softwar...
Team Situational Awareness and Architectural Decision Making with the Softwar...
JOpera - Eclipse-based Visual Composition Environment featuring a general lan...
JOpera - Eclipse-based Visual Composition Environment featuring a general lan...
Service Oriented Architectures and Web Services
Service Oriented Architectures and Web Services
Exploiting Multicores to Optimize Business Process Execution
Exploiting Multicores to Optimize Business Process Execution
Real-time Mashups di Web Service Geografici
Real-time Mashups di Web Service Geografici
Towards Scalable Service Composition on Multicores
Towards Scalable Service Composition on Multicores
USI SCUBE Associate Member
USI SCUBE Associate Member
Lighweight Collaboration Management (Mashups09@OOPSLA)
Lighweight Collaboration Management (Mashups09@OOPSLA)
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Mashups09
Mashups09
Scientific and Grid Workflow Management (SGS09)
Scientific and Grid Workflow Management (SGS09)
Composing REST Services
Composing REST Services
Mashup Ecosystem
Mashup Ecosystem
Mashup Atelier
Mashup Atelier
MetaCDN
MetaCDN
Recently uploaded
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
RankYa
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
Mattias Andersson
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
Miki Katsuragi
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
charlottematthew16
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
DianaGray10
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
hariprasad279825
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
Pixlogix Infotech
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
Sergiu Bodiu
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
Fwdays
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
Rizwan Syed
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
null - The Open Security Community
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
Fwdays
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
Alan Dix
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Mark Simos
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Precisely
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
Lorenzo Miniero
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
Kalema Edgar
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
NavinnSomaal
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
Dilum Bandara
Recently uploaded
(20)
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
Atomic Transactions for the REST of us
1.
Atomic Transactions for
the REST of us Cesare Pautasso Faculty of Informatics University of Lugano, Switzerland c.pautasso@ieee.org http://www.pautasso.info @pautasso
2.
Acknowledgements
This is joint work with Guy Pardon, Atomikos http://www.atomikos.com ©2010 - Cesare Pautasso 2
3.
Does REST need
transactions? If you find yourself in need of a distributed transaction protocol, then how can you possibly say that your architecture is based on REST? I simply cannot see how you can get from one situation (of using RESTful application state on the client and hypermedia to determine all state transitions) to the next situation of needing distributed agreement of transaction semantics wherein the client has to tell the server how to manage its own resources. ...for now I consider "rest transaction" to be an oxymoron. Roy Fielding, REST discuss, June 9th, 2009 ©2010 - Cesare Pautasso 3
4.
Does REST need
transactions? The typical conversation thread, real or virtual, about transactions over HTTP goes something like this (elided for brevity): "You don't want transactions over HTTP" But I need to organize number of steps into a single unit I can deal with easily. "OK, but you don't need transactions over HTTP" But I need the ability to back out changes in multiple locations safely and consistently. "OK, but you can't do transactions over HTTP!" Really? And here the topic usually dies or descends into a heated debate. Mike Amudsen, http://amundsen.com/blog/archives/1024 ©2010 - Cesare Pautasso 4
5.
Context
PUT R RESTful Web Service Persistent Storage ? GET POST DELETE Backend 1 PUT GET S RESTful Web Service Backend 2 POST Database 3 DELETE Adapted from Stefan Tilkov, Using REST for SOA, QCon SFO 2010 ©2010 - Cesare Pautasso 5
6.
The problem
PUT Client State transfer GET R RESTful Web Service POST DELETE State transfer PUT GET S RESTful Web Service POST DELETE Thanks to the idempotency of GET/PUT, each individual state transfer is reliable and atomic ©2010 - Cesare Pautasso 6
7.
The problem
PUT State transfer GET R RESTful Web Service Client POST DELETE State transfer PUT GET S RESTful Web Service POST DELETE How to we make both interactions atomic? ©2010 - Cesare Pautasso 7
8.
Constraints
Interoperability: No changes/extensions to HTTP • No additional verbs • No special/custom headers Loose Coupling: REST shifts all the “work” to the client RESTful Web services should remain unaware they are participating in a transaction Simplicity: Transactions will not be adopted in practice unless they can be made simple enough ©2010 - Cesare Pautasso 8
9.
Assumption: Try-Confirm/Cancel
Resource state transitions follow the TCC pattern Cancel Initial Try Confirm Final State Reserved State Timeout State Before they are made permanent state transitions go through an intermediate “reserved” state which either will be confirmed or canceled by a client within a given time Hint: Cancel/Confirm are idempotent ©2010 - Cesare Pautasso 9
10.
Example: Flight Booking
Resource Try Reserve the flight POST /booking 302 Location: /booking/X URI of the reserved state Confirm PUT /booking/X Pay and confirm 200 the flight Cancel Cancel the DELETE /booking/X reservation 200 ©2010 - Cesare Pautasso 10
11.
Protocol 1.
A client interacts with multiple RESTful Web services. Interactions may lead to state transitions (the intermediate state is identified by a URI known to the client) 2. Once the client has completed all interactions, it uses the URIs identifying the intermediate states to confirm the state transitions (and thus commit the transaction) Note: If the client stops before step 2, the state transitions will eventually be undone by the services themselves (after a timeout). As an optimization, the client can use the same URIs to cancel the state transitions (and thus explicitly rollback the transaction). ©2010 - Cesare Pautasso 11
12.
Simple Example
POST www.swiss.ch/booking 1. 302 Location: /booking/1 POST www.ezyj.com/booking 302 Location:/booking/X PUT www.swiss.ch/booking/1 2. Confirm 200 PUT www.ezyj.com/booking/X 200 ©2010 - Cesare Pautasso 12
13.
What if something
fails? POST www.swiss.ch/booking 1. Whatever 302happens, these Location: /booking/1 state transitions If something fails, are temporary. POST www.ezy.com/booking before moving stop 302 Location:/booking/X to phase 2 PUT www.swiss.ch/booking/1 2. Only idempotent Confirm 200 methods are allowed in the confirmation PUT www.ezy.com/booking/X If something fails, phase. retry as many times 200 as necessary ©2010 - Cesare Pautasso 13
14.
A matter of
timing Timeouts State transitions 1. 2. Try Confirm Time Agreement is reached if the confirmation phase ends before the resources undo the state transitions because of the timeouts ©2010 - Cesare Pautasso 14
15.
A matter of
timing Timeouts State transitions 1. 2. Try Confirm Time If the confirmation runs longer than the earliest timeout we cannot guarantee agreement ©2010 - Cesare Pautasso 15
16.
Timeouts and heuristics
Bad News: As with every distributed agreement protocol, it is impossible to avoid heuristics Good News: thanks to the REST uniform interface we can always do a GET on the URI of the reserved resource to see how much time we have left before it cancels Avoid starting phase 2 if there is not enough time left to confirm with every service More complex preparation: if the resource allows it, extend the reservation time (also idempotent) before starting phase 2. In any case, use a lightweight transaction coordinator to log everything for recovery and human diagnosis of heuristics ©2010 - Cesare Pautasso 16
17.
Architecture (Client-side Transaction)
Try 1 Client Confirm 2 Application 1 Try 3 1 Confirm 5 Confirm 4 2 Transaction 4 Library Try 4 Confirm 2 Client TCC Resources ©2010 - Cesare Pautasso 17
18.
Architecture (Service Composition)
Try 1 0 Confirm Client Workflow 2 6 Engine 1 Try 3 1 Confirm 5 Confirm 4 2 Transaction 4 Coordinator Try 4 Confirm 2 Composite RESTful TCC Service Resources ©2010 - Cesare Pautasso 18
19.
Conclusion
The protocol guarantees atomicity in the event of failures among multiple interactions with RESTful Web services that comply with the TCC pattern. (We are not interested in isolation) No HTTP extension is required Fits very nicely with the REST uniform interface and the idempotency of the PUT/DELETE methods Hypermedia can be easily built in to guide the discovery of the cancellation/confirmation URIs (e.g., with HTTP Link Headers) ©2010 - Cesare Pautasso 19
20.
References
G. Pardon, C. Pautasso, Towards Distributed Atomic Transactions over RESTful Services, in: REST: from Research to Practice, Springer (to appear) Cesare Pautasso, RESTful Web Service Composition with JOpera, Proc. Of the International Conference on Software Composition (SC 2009), Zurich, Switzerland, July 2009. ©2010 - Cesare Pautasso 20
21.
WS-REST 2011
http://ws-rest.org/2011 @WWW2011, Hyderabad, India 28 March 2011 Paper Submission is open (deadline: 31 Jan 2011) ©2010 - Cesare Pautasso 21
22.
©2010 Cesare Pautasso
22