Presentation is loading. Please wait.

Presentation is loading. Please wait.

Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Transaction Processing Kittiphan Techakittiroj

Similar presentations


Presentation on theme: "Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Transaction Processing Kittiphan Techakittiroj"— Presentation transcript:

1 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Transaction Processing Kittiphan Techakittiroj engktc@au.ac.th

2 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Introduction to Transaction and ACID Transacion Models TP Monitors TP-lite & TP-heavy Agenda

3 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Transaction Processing Set of commands to process at once –Faster processing –Reduce the complexity of works Easy example: saving a file not a character

4 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Transaction Processing cont. Big organization: do many things for one operation, e.g. check # of employee, assigned the salary, calculate the tax and make a payment Banking is one example: check clearing

5 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) ACID Properties of Transaction Atomicity: all operations as one item … either success all or fail all Consistency: –correct, accurate, and valid –if the transaction is not success, server return to stable state Isolation: not disturb with other transaction Durability: after commit, the changes should be permanent (not effect by any failure)

6 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Transaction Models Describe the way a transaction can be processed Should be general enough for any kinds of tranasaction Make transactions accomplish the ACID properties

7 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Flat Transaction –Baby Stepping With Flat Transactions –Distributed Flat Transaction Chained Transactions Nested Transactions Models Transaction Models

8 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Contain three steps: –Begin Transaction –Process Transaction –End Transaction Success: commit Failure: abort + rollback Flat Transaction Transaction Models: Models

9 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Flat Transaction Contain three steps: –Begin Transaction –Process Transaction –End Transaction Success: commit Failure: abort + rollback Flat Transaction Providing ACID Transaction Models: Models: Flat Transaction ACID Atomicity Consistency Isolation Durability

10 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Eliminate the problems of Flat Transaction: –holding resource for too long –if abort, the whole works are gone Separate the transaction to be small transactions Baby Stepping with Flat Transaction Transaction Models: Models: Flat Transaction

11 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Extend the Flat Transaction to multiple-site systems Need the synchronization between each site Distributed Flat Transaction Transaction Models: Models: Flat Transaction

12 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) synchronization for Distributed Flat Transaction Consider two types of systems –commit manager node or root node or transaction coordinator –subordinate nodes Two main phases: –Ask everyone to be ready to commit –Ask every one to commit Two Phase Commit Protocol Transaction Models: Models: Flat Transaction: Distributed Flat Transaction

13 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) First Phase –commit manager sends “prepare-to-commit” –commit manager wait for “ready-to-commit” –first phase finish when all nodes is “ready-to-commit” Two Phase Commit Protocol cont. Transaction Models: Models: Flat Transaction: Distributed Flat Transaction

14 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Second Phase –commit manager send “commit” –commit ended: all nodes complete “commit” negative response from any node make commit manager order “rollback” to every nodes Two Phase Commit Protocol cont. Transaction Models: Models: Flat Transaction: Distributed Flat Transaction

15 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) transactions that need to be partially rooled back transactions with humans in the loop: causes the hold of resources for long period (something might also happens on the way, e.g. GUI cracked) Limitations Transaction Models: Models: Flat Transaction

16 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) transaction with long time update large transaction: e.g. updates of million records transaction across companies or the Internet: political and privacy issues Limitations cont. Transaction Models: Models: Flat Transaction

17 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) chaining many transaction together three common patterns: –syncpoints –chained transactions –sagas Chained Transaction Transaction Models: Models:

18 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Make synchronization points in-between transaction Allow the rollback at each synchronization point not durable to the system crash Syncpoints Transaction Models: Models: Chained Transaction

19 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) make the synchronization points become “commit” create “durability” lost “atomic”: the ability to roll-back entired transaction Chained Transaction Transaction Models: Models: Chained Transaction

20 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) same as normal chained transactions but allow the roll-back for the entire transaction this create the “atomic” need to keep track the entired process of transaction Sagas Transaction Models: Models: Chained Transaction

21 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) allow transactions inside a transaction hierarchies of “subtransactions” Nested Transaction Transaction Models: Models:

22 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) TP Monitors process management: start server process, monitor process transaction management: queuing, transaction scheduling, prioritization service communications management between clients and the server

23 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) TP Monitors cont.

24 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) the management over OS two mains functions –pass the client request to server –load balancing Funneling TP Monitor

25 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) load balancing: –create process if necessary –destroy process if possible –however create or destroy processes to often cause the slow down of the systems Main Functions TP Monitor: Funneling

26 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Client/Server application development framework: TP monitor as middleware Firewalls of protection High availability Load balancing Scalability of function Reduced system cost Benefits TP Monitor

27 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) TP-Lite is the concept of embedding TP Monitor into the DBMS TP-Heavy is the way to put TP Monitor as a separate item TP-lite & TP-heavy

28 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Limit by the way the TP monitor is built When nested transaction –TP-Lite is limited because mostly DBMS call nested transaction separately Scope of “commit TP-lite & TP-heavy

29 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Performance TP-lite & TP-heavy TP-Heavy reduce the load of server

30 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Reference Books Client/server survival guide 3 rd edition by Robert Orfali, Dan Harkey, Jeri Edwards (John Wiley & Sons: 1999) Client Server Computing: A Management Overview by Patrick Martin (http://www.natlearn.com.au/cliserco.htm: November1998) Clinet/Server Applications (http://doro.srv.gc.ca/gena/ai/client_e.html: July 1997)

31 Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Reference Books Scale Up with TP Monitors by Jim Gray and Jeri Edwards (Byte Magazine: April 1995) Next-Generation TP Monitors by Nick Gall (http://www.nwc.com/816/816colgall.html: August 1999)


Download ppt "Kittiphan Techakittiroj (09/05/58 10:21 น. 09/05/58 10:21 น. 09/05/58 10:21 น.) Transaction Processing Kittiphan Techakittiroj"

Similar presentations


Ads by Google