Escolar Documentos
Profissional Documentos
Cultura Documentos
indigoo.com
TPM
TRANSACTION
PROCESSING MONITOR
OVERVIEW OF TPM FOR
DISTRIBUTED TRANSACTION PROCESSING
Peter R. Egli
INDIGOO.COM
1/9
Rev. 1.10
indigoo.com
Contents
1.
2.
3.
4.
5.
2/9
Rev. 1.10
indigoo.com
Transfer
Credit account
Server
2
DB
TPM:
TPMs are an early solution for distributed transactions (booking systems, bank account
transfers etc.).
TPMs support distributed database transactions by coordinating multiple DB accesses.
Client
Server
1
DB
Server
2
DB
TPM
3/9
Rev. 1.10
indigoo.com
Account 1
Transfer
1000 CHF
Account 2
Case 1:
Successful Account 1
transaction
-1'000 CHF
or
Case 2:
Account 1
Failed
transaction
-0 CHF
Key
Name
balance_key
Key
balance
Egli
2.95 CHF
Mller
56'342'786'129.98 CHF
Meier
88.70 CHF
Huber
23.67 CHF
Gates
14'78 CHF
Account 2
+1'000 CHF
Account 2
+0 CHF
4/9
Rev. 1.10
indigoo.com
Execution
Execution
Execution
Time
Durability: Transaction is persistent, even in case of errors (crash of DB, error etc.)
Write to DB
Successful
transaction
Write data
to disk buffer
Crash of
DB
Commit data
to disk
Failed
transaction
Commit data to
disk after restart
5/9
Rev. 1.10
indigoo.com
Resource manager:
The resource managers (aka "Cohort") perform the individual transactional DB accesses and
are able to either commit or rollback an individual DB access.
Undo / redo logs:
Undo / redo logs are used by the
transaction managers for transactional
access to their respective DB.
Client interface
for distributed
transactions
Undo/Redo
logs
Resource
manager
(cohort)
Transaction
Manager
(Coordinator)
Undo/Redo
logs
Resource
manager
(cohort)
DB
DB
6/9
Rev. 1.10
indigoo.com
Transaction
Manager
Client
1
Resource
manager
Request
2
Query to commit
Query to commit
Ack (agreement)
Commit
Ack
* Commit
* Release all locks
7
Commit phase
(=completion phase)
Commit
6
Ack (agreement)
5
Commit request
phase
(=voting phase)
* Commit
* Release all locks
Ack
Ack
7/9
Rev. 1.10
indigoo.com
Transaction
Manager
Client
1
Resource
manager
Request
2
Query to commit
Query to commit
Ack (agreement)
Rollback
Ack
* Undo transaction
* Release all locks
7
Commit phase
(=completion phase)
Rollback
6
Commit request
phase
(=voting phase)
* Undo transaction
* Release all locks
Ack
Negative Ack
8/9
Rev. 1.10
indigoo.com
5. TPM structure
TPMs represent complete systems akin to operating systems capable of running entire
applications. Resource managers may be internal or external to the TPM.
Request
Queue
Authentication
Client
E.g. transactional
RPC XA interface=2PC
(X/Open)
TPM
Presentation
Service (application)
Response
Queue
Transaction
Manager
Log manager
(undo/redo)
Resource
manager
DB
Recovery
manager
Binding
Scheduling
Load Balancing
Appl. Lifecycle
9/9
Rev. 1.10