A Standard for Web Services Transactions Dr Mark Little...
Transcript of A Standard for Web Services Transactions Dr Mark Little...
![Page 1: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/1.jpg)
A Standard for Web Services Transactions
Dr Mark LittleEngineering Director, Red Hat
![Page 2: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/2.jpg)
2 Red Hat
Overview
• Transactions and why they are important• Web services and the problems they
present• WS-Coordination, WS-AT and WS-BA• Example scenario
– WS-AT and WS-BA
![Page 3: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/3.jpg)
3 Red Hat
Atomic transactions
• Scoping mechanism that provides “all-or-nothing” semantics
• Enables shared resources to be protectedfrom concurrent users
• ACID properties– Atomic– Consistent– Isolated– Durable
![Page 4: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/4.jpg)
4 Red Hat
Two-phase commit
RDBMS A
B RDBMS
C
Phase 1
COMMIT ?
COMMIT ?
YES
YES
RDBMS A
B RDBMS
C
COMMIT
COMMIT
Phase 2
![Page 5: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/5.jpg)
5 Red Hat
Environmental impact
• ACID transactions implicitly assume– Closely coupled environment
• All entities involved in a transaction span a LAN, forexample.
– Short-duration activities• Must be able to cope with resources being locked for
periods• Therefore, do not work well in
– Loosely coupled environments!– Long duration activities!
![Page 6: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/6.jpg)
6 Red Hat
However …
• Web Services are as much aboutinteroperability as they are about the Web
• In the short term Web Servicestransactions will be about interoperabilitybetween existing TP systems rather thanrunning transactions over the Web
![Page 7: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/7.jpg)
7 Red Hat
B2B interactions
• Business-to-business interactions may becomplex– involving many parties– spanning many different organisations– potentially lasting for hours or days
• Cannot afford to lock resources on behalfof an individual indefinitely
• May need to undo only a subset of work
![Page 8: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/8.jpg)
8 Red Hat
Relaxing isolation
• Internal isolation or resources should be adecision for the service provider
– E.g., commit early and define compensation activities– However, it does impact applications
• Some users may need to know a priori what isolation policiesare being used
• Undo can be whatever is required– Before and after image– Entirely new business processes
![Page 9: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/9.jpg)
9 Red Hat
Relaxing atomicity
• Sometimes it may be desirable to cancel somework without affecting the remainder
– E.g., prefer to get airline seat now even without travelinsurance
• Similar to nested transactions– Work performed within scope of a nested transaction is
provisional– Failure does not affect enclosing transaction
• However, nested transactions may be toorestrictive
– Relaxing isolation
![Page 10: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/10.jpg)
10 Red Hat
WS-AT/WS-BA
• Specifications released by Arjuna, BEA, IBM,IONA and Microsoft– Now OASIS standard
• Separate coordination from transactions– WS-Coordination
• Define two transaction models– AtomicTransaction
• Closely coupled, interoperability– Business Activities
• Compensation based, for long duration activities
![Page 11: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/11.jpg)
11 Red Hat
Web Services Coordination
• Coordination is more fundamental thantransactions– Transactions, security, workflow, replication, …– But each use may require different protocol
• Two-phase, three-phase, QoS specific, …
• Define separate coordination service– Allow customisation for different protocols
![Page 12: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/12.jpg)
12 Red Hat
WS-Coordination
• Defines typical roles of coordinator andparticipant– Coordinator split into two roles
• Activation service– Context
• Registration service– Participant interface is implied by specific protocol
![Page 13: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/13.jpg)
13 Red Hat
Coordination service
Coordinator
Coordination Protocol Messages
Participant
Client
Activ
ation
S
erv
ice
Registration
S
erv
i ce
Proto
co
l
Plu
gin
Ac
tiv
atio
n M
ess
ag
e
Part icipant
Participant
Participant
Service
Service
Service
Con
tro
l M
ess
ag
es
Proto
col D
efinition
WS
DL
Proto
col D
efinition
WS
DL
Key
Application
Level
Coordination
Framework
Web ServiceInfrastructure
Protocol-Specific Entities
![Page 14: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/14.jpg)
14 Red Hat
WS-TX protocols
• Coordinator protocols– Atomic Transaction
• Completion, DurableTwoPhase, VolatileTwoPhase– Business Activity
• BusinessAgreementWithCoordinatorCompletion,BusinessAgreementWithParticipantCompletion
![Page 15: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/15.jpg)
15 Red Hat
WS-AtomicTransaction
• Assume ACID transactions– High degree of trust– Isolation for duration of transaction– Backward compensation techniques– Does not allow heuristic outcomes
• Integration with existing transaction systems– Important to leverage investments
• Interoperability between transaction systems– Something of a holy grail to date
![Page 16: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/16.jpg)
16 Red Hat
Services, participants andcontext
Control RelationControl Relation
Client ApplicationTransaction-Aware Web
Service
Transaction Context
Application Message
Back-End
Database
SQL
Participant
Transaction
Coordinator
Termination M
essage s
Commit/Rollback
Transaction Protocol
Messages
Application Messages
Participant
Term
inat
ion
Mes
sage
s
API API
![Page 17: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/17.jpg)
17 Red Hat
WS-BusinessActivity
• Workflow-like coordination and management• Business activity can be partitioned into tasks
– Parent and child relationships• Select subset of children to complete• Parent can deal with child failures without compromising forward
progress
• Tasks can dynamically exit a business activity• Tasks can indicate outcome earlier than termination
– Up-calls rather than just down-calls
![Page 18: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/18.jpg)
18 Red Hat
WS-BA example
BA
Child BA 3Child BA 2Child BA 1
Customer
Application
Supplier 1
Buy
Suit
Supplier 2
Buy Tie
Supplier 3
Buy
Shoes
Shopping Portal
Buy Outfit
coordinator
![Page 19: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/19.jpg)
19 Red Hat
Compensating BA
BA
CustomerApplication
Shopping Portal
Buy Outfit
coordinator
begin
begin
completed begin
faulted
Child BA 3
Supplier 3
BuyShoes
Child BA 4
Supplier 4
Buy Tie
Child BA 2
Supplier 2
Buy Tie
Child BA 1
Supplier 1
BuySuit
begin
![Page 20: A Standard for Web Services Transactions Dr Mark Little ...events.oasis-open.org/.../events.oasis-open.org.home/files/Little.pdf · Dr Mark Little Engineering Director, Red Hat. 2](https://reader033.fdocuments.in/reader033/viewer/2022042121/5e9ace8759c99d67925fa247/html5/thumbnails/20.jpg)
20 Red Hat
Conclusions
• Transactions are important in mission criticalenvironments– Definition of “transaction” needs to be re-thought for Web
Services– But ACID transactions still important
• OASIS WS-TX defines the standard for WebServices Transactions– Multiple protocols for different use cases– Demonstrated interoperability between
• Red Hat/Jboss• IBM• Microsoft• IONA Technologies