Title: Transactions in an SOA World
1Transactions in an SOA World
Christian Stiller
Applied Architect
2Agenda
- Definition
- Through the ages
- Distributed Database Transactions
- SOA Transactions
- Compensation
- Coordinator
- Managed vs. Un-Managed
- Summary
3Definition Transaction
A transaction is a set of related changes to the
database that the database either completes in
its entirety or discards, leaving no modification
to the database.
OpenEdge Development ABL Handbook
4ACID Properties
- Atomic All or nothing
- Consistent Start End in a Consistent state
- Isolated transactions appear isolated from all
other operations - Durable once notified, the transaction will
persist
5Agenda
- Definition
- Through the ages
- Distributed Database Transactions
- SOA Transactions
- Compensation
- Coordinator
- Managed vs. Un-Managed
- Summary
6Host Based
Application
DO Transaction..
FOR EACH..
REPEAT..
DO ON ERROR..
Update or Read EXCLUSIVE-LOCK..
7Host Based
Client-Server
Application
Client
8Client-Server
n-Tier / Stateless
Client
DO Transaction..
DO ON ERROR..
REPEAT..
FOR EACH..
AppServer
Server
Update or Read EXCLUSIVE-LOCK..
9n-Tier / Stateless
OERA
10OERA Transactions
11Agenda
- Definition
- Through the ages
- Distributed Database Transactions
- SOA Transactions
- Compensation
- Coordinator
- Managed vs. Un-Managed
- Summary
12Definition Distributed Transaction
A distributed transaction is a single
transaction that updates two or more databases.
OpenEdge Data Management Database Admin
13Distributed Transaction
Banking Application
Withdrawal
Deposit
X
14Distributed Transaction 2 Phase Commit
- Ensures transaction consistency across all
databases - All commit or none
- Commit in 2 Phases
- Complete or Roll Back
15Distributed Transaction (2PC)
Banking Application
Withdrawal
Deposit
16Distributed Transaction Limbo Transaction
X
Banking Application
Withdrawal
Deposit
17Agenda
- Definition
- Through the ages
- Distributed Database Transactions
- SOA Transactions
- Compensation
- Coordinator
- Managed vs. Un-Managed
- Summary
18SOA Transactions
- Functionality separated into Services
- Application comprises many Services
- Services as a separate platform
- System Independent Entities
19SOA Transaction Issues
- Multiple services resulting in multiple endpoints
- Loosely coupled systems
- Maintaining Txns only possible in closely
coupled systems - Services based on any platform
- Resources cant be kept in a locked state
- Alternate Recover methods
20Whats needed
- Uniquely identify transaction across services
- Guarantee that data is delivered and
notifications sent - Some form of compensation for when it goes wrong
- Handle errors in asynchronous services
21Possible Solutions
- Compensation
- Transaction Coordinator
22Agenda
- Definition
- Through the ages
- Distributed Database Transactions
- SOA Transactions
- Compensation
- Coordinator
- Managed vs. Un-Managed
- Summary
23Definition Compensation
Compensation is an action taken when something
goes wrong or when there is a change of plan.
IBM Systems Journal April 2002
24Compensation
(5) Error/Exception thrown
(7) Call Compensation
(1) Calls
(3) Calls
Service 1
Service 2
Service 3
(6) Return error
(9) Return Failure
(2) Change DB
(4) Fails
(8) Apply Compensation
25Compensation Issues
- Asynchronous services
- Where to store state details
26Agenda
- Definition
- Through the ages
- Distributed Database Transactions
- SOA Transactions
- Compensation
- Coordinator
- Managed vs. Un-Managed
- Conclusion
27Definition Transaction Coordination
Orchestration of transactions through a
transaction manager or process coordinator.
SOA Systems Feb 2007
28Coordination Service
Coordinator Service
(1) Call
(2) Call
(4) Return
(5) Call
(7) Return Fail
(11) Return Failure
(8) Call Compensation
(10) Return
Service 3
Service 1
Service 2
(3) Change DB
(6) Fails
(9) Apply Compensation
29Coordination Advantages
- Fixes Asynchronous issues of Compensation
- Manages state service information
- Central management of transaction compensation
30Money Transfer
Log
Coordinator Service (generates transaction id and
maintains ACID properties)
(5) Call
(2) Call
(8) Return status
(12) Return status
(9) Call
(3) Return id
(1) request
Client
Initiation Service
Credit Service
Debit Service
(7) Return status
(4) Return id
(11) Return status
(10) Update DB
(6) Update DB
31Agenda
- Definition
- Through the ages
- Distributed Database Transactions
- SOA Transactions
- Compensation
- Coordinator
- Managed vs. Un-Managed
- Summary
32OpenEdge Reference Architecture
Data Sources
33Definition Managed Transaction
A Managed Transaction is managed by the
transaction manager that is built into the
OpenEdge platform. A Managed Transaction can
only access Managed Data Sources
OERA Quick Reference Guide
34Definition Un-Managed Transaction
An Un-Managed Transaction is a transaction that
updates information in an Un-Managed Data Source
or Enterprise Service. An Un-Managed transaction
is not managed by the transaction manager of the
OpenEdge platform.
OERA Quick Reference Guide
35Managed or Un-Managed Transaction?
Managed
36Managed or Un-Managed Transaction?
Managed
37Managed or Un-Managed Transaction?
Un-Managed
38Managed or Un-Managed Transaction?
Managed
39Managed or Un-Managed Transaction?
Un-Managed
40Enterprise Services
Un-Managed
41Money Transfer
Log
Coordinator Service (generates transaction id and
maintains ACID properties)
(5) Call
(2) Call
(8) Return status
(12) Return status
(9) Call
(3) Return id
(1) request
Credit Service
Client
Initiation Service
Debit Service
(7) Return status
(4) Return id
(11) Return status
(10) Update DB
(6) Update DB
42Money Transfer ESB
Log
Dynamic Process Launcher
Coordinator Service (generates transaction id and
maintains ACID properties)
(5) Call
(2) Call
(8) Return status
(12) Return status
(9) Call
(3) Return id
(1) request
Credit Service
Client
Initiation Service
Debit Service
(7) Return status
(4) Return id
(11) Return status
(10) Update DB
(6) Update DB
43Money Transfer BPEL
Log
BPEL Service
Coordinator Service (generates transaction id and
maintains ACID properties)
(5) Call
(2) Call
(8) Return status
(12) Return status
(9) Call
(3) Return id
(1) request
Client
(4) Return id
(7) Return status
(11) Return status
(10) Update DB
(6) Update DB
44BPEL Compensation Handler
Fault Handler
Process (Scope 1)
Compensation Handler S2
Scope 2 Snapshot of Scope 2
Compensation Handler S3
Scope 3 Snapshot of Scope 3
Time
45Agenda
- Definition
- Through the ages
- Distributed Database Transactions
- SOA Transactions
- Compensation
- Coordinator
- Managed vs. Un-Managed
- Summary
46In Summary
- ACID is good, taken in short doses!
- Plan, Design Architect for target
implementation - Choose the appropriate transaction model for you
- Consider ESB BPEL
47For More Information, go to
- PSDN
- Service-oriented Architecture (SOA)
(http//www.psdn.com/library/kbcategory.jspa?categ
oryID55) - Forums http//www.psdn.com/library/forumindex.jspa
- Web Sites
- Sonic Software www.sonicsoftware.com
48Questions?
49Thank you foryour time
50(No Transcript)