SlideShare a Scribd company logo
Submit Search
Upload
Login
Signup
Atomic Transactions for the REST of us
Report
Cesare Pautasso
Follow
Computer Science Prof. at University of Lugano
Jan. 18, 2011
•
0 likes
•
11,742 views
1
of
22
Atomic Transactions for the REST of us
Jan. 18, 2011
•
0 likes
•
11,742 views
Report
Technology
RESTunconf, Munich, January 2011
Cesare Pautasso
Follow
Computer Science Prof. at University of Lugano
Recommended
Peter Afanasiev - Architecture of online Payments
Ciklum Ukraine
8.9K views
•
25 slides
Loan Origination Reference Architecture Deep Dive
Mike Walker
13K views
•
82 slides
Global Payment Reference Architecture
Ramadas MV
5.3K views
•
19 slides
Chatbot Pitch Deck
Ahmad Nizam Mohd Lazim
1.9K views
•
10 slides
Strategies for Monetizing Mobile Content, Services and Applications in 4G and...
Ali Saghaeian
1.2K views
•
32 slides
Banking as a Service (download)
Chris Skinner
20.1K views
•
34 slides
More Related Content
What's hot
Marketing strategy for launching mobile money services in Mexico
Ashish Tandon
8.7K views
•
23 slides
apidays LIVE Singapore - Open Banking: A foundation for the new world by Bhar...
apidays
241 views
•
49 slides
Banking as a Service - An Overview
Srini Peyyalamitta
2.7K views
•
18 slides
Mobile Money Presentation
Microfinance without Borders
3K views
•
30 slides
How Banking as a Service Will Keep Banks Digitally Relevant and Growing
Cognizant
697 views
•
20 slides
Fintech Overview and Growth Drivers
Ratnakar Pandey
1.1K views
•
13 slides
What's hot
(20)
Marketing strategy for launching mobile money services in Mexico
Ashish Tandon
•
8.7K views
apidays LIVE Singapore - Open Banking: A foundation for the new world by Bhar...
apidays
•
241 views
Banking as a Service - An Overview
Srini Peyyalamitta
•
2.7K views
Mobile Money Presentation
Microfinance without Borders
•
3K views
How Banking as a Service Will Keep Banks Digitally Relevant and Growing
Cognizant
•
697 views
Fintech Overview and Growth Drivers
Ratnakar Pandey
•
1.1K views
VERS UNE BANQUE MOBILE ? CHAPITRE 1 : Concevoir un produit bancaire remarquable
OCTO Technology
•
11.1K views
Digital banking
VIPIN KP
•
699 views
Backbase On-Demand Webinar: Banking 2025
Backbase
•
4.3K views
Digital Banking vs. Branch Banking (Ashish Kumar)
2K13A19
•
6.4K views
Loan Management System in Oracle
Ranojit Banerjee
•
6.2K views
Open banking-Future of Banking
farhan ali
•
337 views
Branchless Banking in Pakistan
Shoaib Lalani
•
6.2K views
Online banking
Prince Subhadeep Mandal
•
2.1K views
Digital Banking
Nikolay Spasov
•
25.3K views
We bank digital banking decoded for bnm 0618 v1.9(3)
Chris Skinner
•
7.9K views
Reference Architecture for Shared Services Hosting_SunilBabu_V2.0
Sunil Babu
•
1.4K views
Ca Service Desk Presentation
Emirates Computers
•
21.6K views
Digital bank
Malkhaz Pertaia
•
700 views
Developing Multimedia and Value Added Services (VAS) on 4G and 4.5G for Telec...
Ali Saghaeian
•
11.3K views
Viewers also liked
Developing “RESTful transactions” with Apache Sling
Senol Tas
3.9K views
•
28 slides
The New Way of Developing with AEM 6.0 | Sightly | Beautiful Markup
Senol Tas
5.3K views
•
31 slides
Adobe Sneak Peak - Introducing HTL @ Evovle'13
Senol Tas
1.5K views
•
13 slides
Real World REST with Atom/AtomPub
Peter Keane
4K views
•
29 slides
Performance monitoring and call tracing in microservice environments
Martin Gutenbrunner
2.4K views
•
57 slides
Security for netflix billing & payments (meetup)
Poornaprajna Udupi
79.2K views
•
8 slides
Viewers also liked
(10)
Developing “RESTful transactions” with Apache Sling
Senol Tas
•
3.9K views
The New Way of Developing with AEM 6.0 | Sightly | Beautiful Markup
Senol Tas
•
5.3K views
Adobe Sneak Peak - Introducing HTL @ Evovle'13
Senol Tas
•
1.5K views
Real World REST with Atom/AtomPub
Peter Keane
•
4K views
Performance monitoring and call tracing in microservice environments
Martin Gutenbrunner
•
2.4K views
Security for netflix billing & payments (meetup)
Poornaprajna Udupi
•
79.2K views
3/18/15 Billing&Payments Eng Meetup II - Payments Processing in the Cloud
Mathieu Chauvin
•
79.5K views
Escape From PCI Land
Rahul Dani
•
78.8K views
IBM Bluemix Overview
Ian Lynch ☁️
•
18.1K views
Design Beautiful REST + JSON APIs
Stormpath
•
225.8K views
Similar to Atomic Transactions for the REST of us
BPM with REST
Cesare Pautasso
3K views
•
50 slides
RESTful Service Composition with JOpera
Cesare Pautasso
2K views
•
56 slides
SOA2010 SOA with REST
Cesare Pautasso
3.7K views
•
40 slides
Techniques for Composing REST services - SOA Symposium 2009
Cesare Pautasso
2.8K views
•
47 slides
SOA with REST
Cesare Pautasso
5.3K views
•
48 slides
Push-Enabling RESTful Business Processes
Cesare Pautasso
3.2K views
•
43 slides
Similar to Atomic Transactions for the REST of us
(18)
BPM with REST
Cesare Pautasso
•
3K views
RESTful Service Composition with JOpera
Cesare Pautasso
•
2K views
SOA2010 SOA with REST
Cesare Pautasso
•
3.7K views
Techniques for Composing REST services - SOA Symposium 2009
Cesare Pautasso
•
2.8K views
SOA with REST
Cesare Pautasso
•
5.3K views
Push-Enabling RESTful Business Processes
Cesare Pautasso
•
3.2K views
BPMN for REST
Cesare Pautasso
•
9.9K views
Www2008 Restws Pautasso Talk
Kalyan Vijay Kumar Pasumarthi
•
255 views
WS-* vs. RESTful Services
Cesare Pautasso
•
8.4K views
Composing RESTful Services with JOpera
Cesare Pautasso
•
996 views
Composing REST Services
elliando dias
•
960 views
REST vs. SOAP
Murat Çakal
•
11.8K views
Building+restful+webservice
lonegunman
•
357 views
Web of Things - Connecting People and Objects on the Web
Dominique Guinard
•
4.8K views
Cesare Pautasso R E S T V1
SOA Symposium
•
1.1K views
WebSocket protocol
Kensaku Komatsu
•
3.7K views
Protecting Multi-Interfaced Mobile Web Services using Agreements
Dr. Fahad Aijaz
•
273 views
Take a REST!
Vladimir Tsukur
•
4.2K views
More from Cesare Pautasso
Beautiful APIs - SOSE2021 Keynote
Cesare Pautasso
89 views
•
103 slides
How do you back up and consistently recover your microservice architecture?
Cesare Pautasso
391 views
•
99 slides
Microservices: An Eventually Inconsistent Architectural Style?
Cesare Pautasso
423 views
•
79 slides
Disaster Recovery and Microservices: The BAC Theorem
Cesare Pautasso
943 views
•
72 slides
The Blockchain as a Software Connector
Cesare Pautasso
6.5K views
•
34 slides
Team Situational Awareness and Architectural Decision Making with the Softwar...
Cesare Pautasso
2.3K views
•
50 slides
More from Cesare Pautasso
(20)
Beautiful APIs - SOSE2021 Keynote
Cesare Pautasso
•
89 views
How do you back up and consistently recover your microservice architecture?
Cesare Pautasso
•
391 views
Microservices: An Eventually Inconsistent Architectural Style?
Cesare Pautasso
•
423 views
Disaster Recovery and Microservices: The BAC Theorem
Cesare Pautasso
•
943 views
The Blockchain as a Software Connector
Cesare Pautasso
•
6.5K views
Team Situational Awareness and Architectural Decision Making with the Softwar...
Cesare Pautasso
•
2.3K views
JOpera - Eclipse-based Visual Composition Environment featuring a general lan...
Cesare Pautasso
•
1.5K views
Service Oriented Architectures and Web Services
Cesare Pautasso
•
4.4K views
Exploiting Multicores to Optimize Business Process Execution
Cesare Pautasso
•
680 views
Real-time Mashups di Web Service Geografici
Cesare Pautasso
•
2K views
Towards Scalable Service Composition on Multicores
Cesare Pautasso
•
652 views
USI SCUBE Associate Member
Cesare Pautasso
•
585 views
Lighweight Collaboration Management (Mashups09@OOPSLA)
Cesare Pautasso
•
1.1K views
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Cesare Pautasso
•
22.4K views
Mashups09
Cesare Pautasso
•
313 views
Scientific and Grid Workflow Management (SGS09)
Cesare Pautasso
•
1.4K views
Composing REST Services
Cesare Pautasso
•
2.9K views
Mashup Ecosystem
Cesare Pautasso
•
7.1K views
Mashup Atelier
Cesare Pautasso
•
697 views
MetaCDN
Cesare Pautasso
•
2.4K views
Recently uploaded
Empowering City Clerks
OnBoard
101 views
•
12 slides
Product Research Presentation
DeahJadeArellano
34 views
•
13 slides
Accelerating Data Science through Feature Platform, Transformers and GenAI
FeatureByte
127 views
•
44 slides
Dennis Wendland_The i4Trust Collaboration Programme.pptx
FIWARE
16 views
•
17 slides
Mastering Automation Quality: Exploring UiPath's Test Suite for Seamless Test...
DianaGray10
44 views
•
20 slides
GDSC ZHCET Google Study Jams 23.pdf
AbhishekSingh313342
26 views
•
34 slides
Recently uploaded
(20)
Empowering City Clerks
OnBoard
•
101 views
Product Research Presentation
DeahJadeArellano
•
34 views
Accelerating Data Science through Feature Platform, Transformers and GenAI
FeatureByte
•
127 views
Dennis Wendland_The i4Trust Collaboration Programme.pptx
FIWARE
•
16 views
Mastering Automation Quality: Exploring UiPath's Test Suite for Seamless Test...
DianaGray10
•
44 views
GDSC ZHCET Google Study Jams 23.pdf
AbhishekSingh313342
•
26 views
OpenAI API crash course
Dimitrios Platis
•
22 views
Google cloud Study Jam 2023.pptx
GDSCNiT
•
489 views
"The Intersection of architecture and implementation", Mark Richards
Fwdays
•
53 views
Common WordPress APIs_ Settings API
Jonathan Bossenger
•
32 views
Brisbane MuleSoft Meetup 13 MuleSoft Maven and Managing Dependencies Part 1.pptx
BrianFraser29
•
17 views
alfred-product-research-proposal.pdf
AlfredSuratos
•
24 views
10 reasons to choose Galaxy Tab S9 for work on the go
Samsung Business USA
•
95 views
Reward Innovation for long-term member satisfaction
Jiangwei Pan
•
46 views
"Architecture assessment from classics to details", Dmytro Ovcharenko
Fwdays
•
55 views
Solving today’s Traffic Problems with Sustainable Ride Hailing Solution
On Demand Clone
•
44 views
Product Listing Presentation-Maidy Veloso.pptx
MaidyVeloso
•
61 views
Cloud Study Jam ppt.pptx
Poorabpatel
•
31 views
The Flutter Job Market At The Moment
Ahmed Abu Eldahab
•
44 views
"Intro to Stateful Services or How to get 1 million RPS from a single node", ...
Fwdays
•
19 views
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