• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Transaction Processing Monitors (TPM)
 

Transaction Processing Monitors (TPM)

on

  • 525 views

Transaction Processing Monitors represent an early type of middleware that is still widely used for performing distributed transactions involving multiple databases. ...

Transaction Processing Monitors represent an early type of middleware that is still widely used for performing distributed transactions involving multiple databases.
Usually TPMs employ the two phase commit protocol that ensures ACID properties (Atomicity, Consistency, Isolation, Durability) as in relational databases.

Statistics

Views

Total Views
525
Views on SlideShare
524
Embed Views
1

Actions

Likes
0
Downloads
3
Comments
0

1 Embed 1

http://www.slideee.com 1

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Transaction Processing Monitors (TPM) Transaction Processing Monitors (TPM) Presentation Transcript

    • TPM – Transaction Processing Monitor indigoo.com • Contents 1. What are Transaction Processing Monitors? 2. Properties of DB transactions 3. Two-Phase Commit architecture 4. Two-Phase Commit sequence 5. TPM structure © Peter R. Egli 2014 1/8 Rev. 1.00
    • TPM – Transaction Processing Monitor indigoo.com 1. What are Transaction Processing Monitors (TPM)? Typical problem of distributed applications: Operations involving multiple databases (DB) require transactional access. The operation is either successful or fails, but always has to leave all involved databases in a consistent state. Debit account Server DB 1 Client 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. Server 1 Server 2 Client © Peter R. Egli 2014 DB DB TPM 2/8 Rev. 1.00
    • TPM – Transaction Processing Monitor indigoo.com 2. Properties of DB transactions (1/2) Relational databases support ACID properties: 1. Atomicity 2. Consistency 3. Isolation 4. Durability Atomicity: Consistent state before & after transaction. Account 1 Transfer 1000 CHF Account 2 Consistency: No integrity constraint violations Case 1: Successful Account 1 transaction -1'000 CHF or Case 2: Account 1 Failed transaction -0 CHF Key Name balance_key Key Egli 3 1 Müller 1 2 Meier 5 3 88.70 CHF 4 Huber 7 4 23.67 CHF 5 Gates 2 5 +0 CHF 56'342'786'129.98 CHF 3 Account 2 2.95 CHF 2 +1'000 CHF balance 1 Account 2 14'78 CHF Integrity violation (missing entry with key=7) © Peter R. Egli 2014 3/8 Rev. 1.00
    • TPM – Transaction Processing Monitor indigoo.com 2. Properties of DB transactions (2/2) Isolation: DB accesses are isolated from each other so they do not impact each other. Typically this is done with some sort of locking of resources (tables in DB) and serialization of the requests. Request 2 Request 2 Request 1 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 © Peter R. Egli 2014 Commit data to disk Failed transaction Commit data to disk after restart 4/8 Rev. 1.00
    • TPM – Transaction Processing Monitor indigoo.com 3. Two-Phase Commit architecture TPMs employ a mechanism called Two-Phase Commit to support distributed DB transactions. Transaction manager (Coordinator): The coordinator serves as coordination point in the distributed transaction. 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) © Peter R. Egli 2014 DB DB 5/8 Rev. 1.00
    • TPM – Transaction Processing Monitor indigoo.com 4. Two-Phase Commit sequence (1/2) A. Successful transaction: When all transaction managers agree with the commit (vote "yes"), the transaction can be successfully committed. Resource manager Transaction Manager Client 1 Resource manager Request 2 2 4 Query to commit Query to commit Ack (agreement) 3 * Prepare for commit * Write undo / redo logs 4 © Peter R. Egli 2014 Commit Ack * Commit * Release all locks 7 8 * Prepare for commit * Write undo / redo logs Commit phase (=completion phase) Commit 6 7 3 Ack (agreement) 5 5 Commit request phase (=voting phase) 6 * Commit * Release all locks Ack Ack 6/8 Rev. 1.00
    • TPM – Transaction Processing Monitor indigoo.com 4. Two-Phase Commit sequence (2/2) A. Failed transaction: When either of the transaction manager does not positively acknowledge the transaction, the coordinator sends a rollback command to all transaction managers. Resource manager Transaction Manager Client 1 Resource manager Request 2 2 4 Query to commit Query to commit Ack (agreement) 3 * Prepare for commit * Write undo / redo logs 4 © Peter R. Egli 2014 Rollback Ack * Undo transaction * Release all locks 7 8 * Prepare for commit * Write undo / redo logs Commit phase (=completion phase) Rollback 6 7 3 Not Ack (or timeout) 5 5 Commit request phase (=voting phase) 6 * Undo transaction * Release all locks Ack Negative Ack 7/8 Rev. 1.00
    • TPM – Transaction Processing Monitor 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 © Peter R. Egli 2014 8/8 Rev. 1.00