SlideShare a Scribd company logo
1 of 22
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
Acknowledgements
            This is joint work with Guy Pardon, Atomikos




                          http://www.atomikos.com



©2010 - Cesare Pautasso                                     2
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
©2010 Cesare Pautasso   22

More Related Content

What's hot

"Embedded Vision Made Smart: Introduction to the HALCON Embedded Machine Visi...
"Embedded Vision Made Smart: Introduction to the HALCON Embedded Machine Visi..."Embedded Vision Made Smart: Introduction to the HALCON Embedded Machine Visi...
"Embedded Vision Made Smart: Introduction to the HALCON Embedded Machine Visi...Edge AI and Vision Alliance
 
[JCConf 2022] Compose for Desktop - 開發桌面軟體的新選擇
[JCConf 2022] Compose for Desktop - 開發桌面軟體的新選擇[JCConf 2022] Compose for Desktop - 開發桌面軟體的新選擇
[JCConf 2022] Compose for Desktop - 開發桌面軟體的新選擇Shengyou Fan
 
오픈소스 ROS와 AWS RoboMaker를 통한 지능형 로봇앱 개발하기 - 윤석찬 (AWS 테크에반젤리스트), 박진용 (우아한 형제들) ...
오픈소스 ROS와 AWS RoboMaker를 통한 지능형 로봇앱 개발하기 - 윤석찬 (AWS 테크에반젤리스트), 박진용 (우아한 형제들) ...오픈소스 ROS와 AWS RoboMaker를 통한 지능형 로봇앱 개발하기 - 윤석찬 (AWS 테크에반젤리스트), 박진용 (우아한 형제들) ...
오픈소스 ROS와 AWS RoboMaker를 통한 지능형 로봇앱 개발하기 - 윤석찬 (AWS 테크에반젤리스트), 박진용 (우아한 형제들) ...Amazon Web Services Korea
 
Fibre Channel over Ethernet (FCoE), iSCSI and the Converged Data Center
Fibre Channel over Ethernet (FCoE), iSCSI and the Converged Data CenterFibre Channel over Ethernet (FCoE), iSCSI and the Converged Data Center
Fibre Channel over Ethernet (FCoE), iSCSI and the Converged Data CenterStuart Miniman
 
Web 3.0 (Presentation)
Web 3.0 (Presentation)Web 3.0 (Presentation)
Web 3.0 (Presentation)Allan Cho
 
Decentraland. A blockchain-based virtual world. Whitepaper
Decentraland. A blockchain-based virtual world.  WhitepaperDecentraland. A blockchain-based virtual world.  Whitepaper
Decentraland. A blockchain-based virtual world. Whitepapereraser Juan José Calderón
 
Flutter state management from zero to hero
Flutter state management from zero to heroFlutter state management from zero to hero
Flutter state management from zero to heroAhmed Abu Eldahab
 
Angular - a real world case study
Angular - a real world case studyAngular - a real world case study
Angular - a real world case studydwcarter74
 
Introduction to Apache Pig
Introduction to Apache PigIntroduction to Apache Pig
Introduction to Apache PigJason Shao
 
IoT Technology Tutorial | IoT Technology Stack | IoT Project Hands-On | Edureka
IoT Technology Tutorial | IoT Technology Stack | IoT Project Hands-On | EdurekaIoT Technology Tutorial | IoT Technology Stack | IoT Project Hands-On | Edureka
IoT Technology Tutorial | IoT Technology Stack | IoT Project Hands-On | EdurekaEdureka!
 
What Is Apache Spark? | Introduction To Apache Spark | Apache Spark Tutorial ...
What Is Apache Spark? | Introduction To Apache Spark | Apache Spark Tutorial ...What Is Apache Spark? | Introduction To Apache Spark | Apache Spark Tutorial ...
What Is Apache Spark? | Introduction To Apache Spark | Apache Spark Tutorial ...Simplilearn
 
What is a Full stack developer? - Tech talk
What is a Full stack developer? - Tech talk What is a Full stack developer? - Tech talk
What is a Full stack developer? - Tech talk Bui Hai An
 
Internet of Things, Innovation and India by Syam Madanapalli
Internet of Things, Innovation and India by Syam MadanapalliInternet of Things, Innovation and India by Syam Madanapalli
Internet of Things, Innovation and India by Syam MadanapalliSyam Madanapalli
 
Standards for the Metaverse
Standards for the MetaverseStandards for the Metaverse
Standards for the MetaverseDamon Hernandez
 

What's hot (20)

"Embedded Vision Made Smart: Introduction to the HALCON Embedded Machine Visi...
"Embedded Vision Made Smart: Introduction to the HALCON Embedded Machine Visi..."Embedded Vision Made Smart: Introduction to the HALCON Embedded Machine Visi...
"Embedded Vision Made Smart: Introduction to the HALCON Embedded Machine Visi...
 
[JCConf 2022] Compose for Desktop - 開發桌面軟體的新選擇
[JCConf 2022] Compose for Desktop - 開發桌面軟體的新選擇[JCConf 2022] Compose for Desktop - 開發桌面軟體的新選擇
[JCConf 2022] Compose for Desktop - 開發桌面軟體的新選擇
 
오픈소스 ROS와 AWS RoboMaker를 통한 지능형 로봇앱 개발하기 - 윤석찬 (AWS 테크에반젤리스트), 박진용 (우아한 형제들) ...
오픈소스 ROS와 AWS RoboMaker를 통한 지능형 로봇앱 개발하기 - 윤석찬 (AWS 테크에반젤리스트), 박진용 (우아한 형제들) ...오픈소스 ROS와 AWS RoboMaker를 통한 지능형 로봇앱 개발하기 - 윤석찬 (AWS 테크에반젤리스트), 박진용 (우아한 형제들) ...
오픈소스 ROS와 AWS RoboMaker를 통한 지능형 로봇앱 개발하기 - 윤석찬 (AWS 테크에반젤리스트), 박진용 (우아한 형제들) ...
 
Delta Architecture
Delta ArchitectureDelta Architecture
Delta Architecture
 
Fibre Channel over Ethernet (FCoE), iSCSI and the Converged Data Center
Fibre Channel over Ethernet (FCoE), iSCSI and the Converged Data CenterFibre Channel over Ethernet (FCoE), iSCSI and the Converged Data Center
Fibre Channel over Ethernet (FCoE), iSCSI and the Converged Data Center
 
Web 3.0 (Presentation)
Web 3.0 (Presentation)Web 3.0 (Presentation)
Web 3.0 (Presentation)
 
Decentraland. A blockchain-based virtual world. Whitepaper
Decentraland. A blockchain-based virtual world.  WhitepaperDecentraland. A blockchain-based virtual world.  Whitepaper
Decentraland. A blockchain-based virtual world. Whitepaper
 
Flutter state management from zero to hero
Flutter state management from zero to heroFlutter state management from zero to hero
Flutter state management from zero to hero
 
Angular - a real world case study
Angular - a real world case studyAngular - a real world case study
Angular - a real world case study
 
Introduction to Apache Pig
Introduction to Apache PigIntroduction to Apache Pig
Introduction to Apache Pig
 
IoT Technology Tutorial | IoT Technology Stack | IoT Project Hands-On | Edureka
IoT Technology Tutorial | IoT Technology Stack | IoT Project Hands-On | EdurekaIoT Technology Tutorial | IoT Technology Stack | IoT Project Hands-On | Edureka
IoT Technology Tutorial | IoT Technology Stack | IoT Project Hands-On | Edureka
 
What Is Apache Spark? | Introduction To Apache Spark | Apache Spark Tutorial ...
What Is Apache Spark? | Introduction To Apache Spark | Apache Spark Tutorial ...What Is Apache Spark? | Introduction To Apache Spark | Apache Spark Tutorial ...
What Is Apache Spark? | Introduction To Apache Spark | Apache Spark Tutorial ...
 
Metaverse webinar 05042018
Metaverse webinar 05042018Metaverse webinar 05042018
Metaverse webinar 05042018
 
What is a Full stack developer? - Tech talk
What is a Full stack developer? - Tech talk What is a Full stack developer? - Tech talk
What is a Full stack developer? - Tech talk
 
introduction to Lamp Stack
introduction to Lamp Stackintroduction to Lamp Stack
introduction to Lamp Stack
 
IPFS: The Permanent Web
IPFS: The Permanent WebIPFS: The Permanent Web
IPFS: The Permanent Web
 
Internet of Things, Innovation and India by Syam Madanapalli
Internet of Things, Innovation and India by Syam MadanapalliInternet of Things, Innovation and India by Syam Madanapalli
Internet of Things, Innovation and India by Syam Madanapalli
 
AR/SLAM and IoT
AR/SLAM and IoTAR/SLAM and IoT
AR/SLAM and IoT
 
Standards for the Metaverse
Standards for the MetaverseStandards for the Metaverse
Standards for the Metaverse
 
Iot ppt
Iot pptIot ppt
Iot ppt
 

Viewers also liked

Developing “RESTful transactions” with Apache Sling
Developing “RESTful transactions” with Apache SlingDeveloping “RESTful transactions” with Apache Sling
Developing “RESTful transactions” with Apache SlingSenol Tas
 
The New Way of Developing with AEM 6.0 | Sightly | Beautiful Markup
The New Way of Developing with AEM 6.0 | Sightly | Beautiful MarkupThe New Way of Developing with AEM 6.0 | Sightly | Beautiful Markup
The New Way of Developing with AEM 6.0 | Sightly | Beautiful MarkupSenol Tas
 
Adobe Sneak Peak - Introducing HTL @ Evovle'13
Adobe Sneak Peak - Introducing HTL @ Evovle'13Adobe Sneak Peak - Introducing HTL @ Evovle'13
Adobe Sneak Peak - Introducing HTL @ Evovle'13Senol Tas
 
Real World REST with Atom/AtomPub
Real World REST with Atom/AtomPubReal World REST with Atom/AtomPub
Real World REST with Atom/AtomPubPeter Keane
 
Performance monitoring and call tracing in microservice environments
Performance monitoring and call tracing in microservice environmentsPerformance monitoring and call tracing in microservice environments
Performance monitoring and call tracing in microservice environmentsMartin Gutenbrunner
 
Security for netflix billing & payments (meetup)
Security for netflix billing & payments (meetup)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 Cloud3/18/15 Billing&Payments Eng Meetup II - Payments Processing in the Cloud
3/18/15 Billing&Payments Eng Meetup II - Payments Processing in the CloudMathieu Chauvin
 
Escape From PCI Land
Escape From PCI LandEscape From PCI Land
Escape From PCI LandRahul Dani
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsStormpath
 

Viewers also liked (10)

Developing “RESTful transactions” with Apache Sling
Developing “RESTful transactions” with Apache SlingDeveloping “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 MarkupThe 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'13Adobe Sneak Peak - Introducing HTL @ Evovle'13
Adobe Sneak Peak - Introducing HTL @ Evovle'13
 
Real World REST with Atom/AtomPub
Real World REST with Atom/AtomPubReal 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 environmentsPerformance 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)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 Cloud3/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 LandEscape From PCI Land
Escape From PCI Land
 
IBM Bluemix Overview
IBM Bluemix OverviewIBM Bluemix Overview
IBM Bluemix Overview
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
 

Similar to Atomic Transactions for the REST of us

RESTful Service Composition with JOpera
RESTful Service Composition with JOperaRESTful Service Composition with JOpera
RESTful Service Composition with JOperaCesare Pautasso
 
Techniques for Composing REST services - SOA Symposium 2009
Techniques for Composing REST services - SOA Symposium 2009Techniques for Composing REST services - SOA Symposium 2009
Techniques for Composing REST services - SOA Symposium 2009Cesare Pautasso
 
Push-Enabling RESTful Business Processes
Push-Enabling RESTful Business ProcessesPush-Enabling RESTful Business Processes
Push-Enabling RESTful Business ProcessesCesare Pautasso
 
WS-* vs. RESTful Services
WS-* vs. RESTful ServicesWS-* vs. RESTful Services
WS-* vs. RESTful ServicesCesare Pautasso
 
Composing RESTful Services with JOpera
Composing RESTful Services with JOperaComposing RESTful Services with JOpera
Composing RESTful Services with JOperaCesare Pautasso
 
Composing REST Services
Composing REST ServicesComposing REST Services
Composing REST Serviceselliando dias
 
Building+restful+webservice
Building+restful+webserviceBuilding+restful+webservice
Building+restful+webservicelonegunman
 
Web of Things - Connecting People and Objects on the Web
Web of Things - Connecting People and Objects on the WebWeb of Things - Connecting People and Objects on the Web
Web of Things - Connecting People and Objects on the WebDominique Guinard
 
Cesare Pautasso R E S T V1
Cesare  Pautasso    R E S T V1Cesare  Pautasso    R E S T V1
Cesare Pautasso R E S T V1SOA Symposium
 
Protecting Multi-Interfaced Mobile Web Services using Agreements
Protecting Multi-Interfaced Mobile Web Services using Agreements Protecting Multi-Interfaced Mobile Web Services using Agreements
Protecting Multi-Interfaced Mobile Web Services using Agreements Dr. Fahad Aijaz
 

Similar to Atomic Transactions for the REST of us (18)

BPM with REST
BPM with RESTBPM with REST
BPM with REST
 
RESTful Service Composition with JOpera
RESTful Service Composition with JOperaRESTful Service Composition with JOpera
RESTful Service Composition with JOpera
 
SOA2010 SOA with REST
SOA2010 SOA with RESTSOA2010 SOA with REST
SOA2010 SOA with REST
 
Techniques for Composing REST services - SOA Symposium 2009
Techniques for Composing REST services - SOA Symposium 2009Techniques for Composing REST services - SOA Symposium 2009
Techniques for Composing REST services - SOA Symposium 2009
 
SOA with REST
SOA with RESTSOA with REST
SOA with REST
 
Push-Enabling RESTful Business Processes
Push-Enabling RESTful Business ProcessesPush-Enabling RESTful Business Processes
Push-Enabling RESTful Business Processes
 
BPMN for REST
BPMN for RESTBPMN for REST
BPMN for REST
 
Www2008 Restws Pautasso Talk
Www2008 Restws Pautasso TalkWww2008 Restws Pautasso Talk
Www2008 Restws Pautasso Talk
 
WS-* vs. RESTful Services
WS-* vs. RESTful ServicesWS-* vs. RESTful Services
WS-* vs. RESTful Services
 
Composing RESTful Services with JOpera
Composing RESTful Services with JOperaComposing RESTful Services with JOpera
Composing RESTful Services with JOpera
 
Composing REST Services
Composing REST ServicesComposing REST Services
Composing REST Services
 
REST vs. SOAP
REST vs. SOAPREST vs. SOAP
REST vs. SOAP
 
Building+restful+webservice
Building+restful+webserviceBuilding+restful+webservice
Building+restful+webservice
 
Web of Things - Connecting People and Objects on the Web
Web of Things - Connecting People and Objects on the WebWeb 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 V1Cesare  Pautasso    R E S T V1
Cesare Pautasso R E S T V1
 
WebSocket protocol
WebSocket protocolWebSocket protocol
WebSocket protocol
 
Protecting Multi-Interfaced Mobile Web Services using Agreements
Protecting Multi-Interfaced Mobile Web Services using Agreements Protecting Multi-Interfaced Mobile Web Services using Agreements
Protecting Multi-Interfaced Mobile Web Services using Agreements
 
Take a REST!
Take a REST!Take a REST!
Take a REST!
 

More from Cesare Pautasso

Beautiful APIs - SOSE2021 Keynote
Beautiful APIs - SOSE2021 KeynoteBeautiful APIs - SOSE2021 Keynote
Beautiful APIs - SOSE2021 KeynoteCesare Pautasso
 
How do you back up and consistently recover your microservice architecture?
How do you back up and consistently recover your microservice architecture?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?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 TheoremDisaster Recovery and Microservices: The BAC Theorem
Disaster Recovery and Microservices: The BAC TheoremCesare Pautasso
 
The Blockchain as a Software Connector
The Blockchain as a Software ConnectorThe Blockchain as a Software Connector
The Blockchain as a Software ConnectorCesare Pautasso
 
Team Situational Awareness and Architectural Decision Making with the Softwar...
Team Situational Awareness and Architectural Decision Making with the Softwar...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...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 ServicesService Oriented Architectures and Web Services
Service Oriented Architectures and Web ServicesCesare Pautasso
 
Exploiting Multicores to Optimize Business Process Execution
Exploiting Multicores to Optimize Business Process ExecutionExploiting Multicores to Optimize Business Process Execution
Exploiting Multicores to Optimize Business Process ExecutionCesare Pautasso
 
Real-time Mashups di Web Service Geografici
Real-time Mashups di Web Service GeograficiReal-time Mashups di Web Service Geografici
Real-time Mashups di Web Service GeograficiCesare Pautasso
 
Towards Scalable Service Composition on Multicores
Towards Scalable Service Composition on MulticoresTowards Scalable Service Composition on Multicores
Towards Scalable Service Composition on MulticoresCesare Pautasso
 
USI SCUBE Associate Member
USI SCUBE Associate MemberUSI SCUBE Associate Member
USI SCUBE Associate MemberCesare Pautasso
 
Lighweight Collaboration Management (Mashups09@OOPSLA)
Lighweight Collaboration Management (Mashups09@OOPSLA)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 2009Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009Cesare Pautasso
 
Scientific and Grid Workflow Management (SGS09)
Scientific and Grid Workflow Management (SGS09)Scientific and Grid Workflow Management (SGS09)
Scientific and Grid Workflow Management (SGS09)Cesare Pautasso
 

More from Cesare Pautasso (20)

Beautiful APIs - SOSE2021 Keynote
Beautiful APIs - SOSE2021 KeynoteBeautiful 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?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?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 TheoremDisaster Recovery and Microservices: The BAC Theorem
Disaster Recovery and Microservices: The BAC Theorem
 
The Blockchain as a Software Connector
The Blockchain as a Software ConnectorThe 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...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...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 ServicesService Oriented Architectures and Web Services
Service Oriented Architectures and Web Services
 
Exploiting Multicores to Optimize Business Process Execution
Exploiting Multicores to Optimize Business Process ExecutionExploiting 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 GeograficiReal-time Mashups di Web Service Geografici
Real-time Mashups di Web Service Geografici
 
Towards Scalable Service Composition on Multicores
Towards Scalable Service Composition on MulticoresTowards Scalable Service Composition on Multicores
Towards Scalable Service Composition on Multicores
 
USI SCUBE Associate Member
USI SCUBE Associate MemberUSI SCUBE Associate Member
USI SCUBE Associate Member
 
Lighweight Collaboration Management (Mashups09@OOPSLA)
Lighweight Collaboration Management (Mashups09@OOPSLA)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 2009Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
 
Mashups09
Mashups09Mashups09
Mashups09
 
Scientific and Grid Workflow Management (SGS09)
Scientific and Grid Workflow Management (SGS09)Scientific and Grid Workflow Management (SGS09)
Scientific and Grid Workflow Management (SGS09)
 
Composing REST Services
Composing REST ServicesComposing REST Services
Composing REST Services
 
Mashup Ecosystem
Mashup EcosystemMashup Ecosystem
Mashup Ecosystem
 
Mashup Atelier
Mashup AtelierMashup Atelier
Mashup Atelier
 
MetaCDN
MetaCDNMetaCDN
MetaCDN
 

Recently uploaded

UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxUdaiappa Ramachandran
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 

Recently uploaded (20)

UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptx
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 

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