notes11

notes11 - CS216: Data-Intensive Computing Systems...

Info iconThis preview shows pages 1–15. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CS216: Data-Intensive Computing Systems Shivnath Babu Concurrency Control
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Transaction • Programming abstraction • Implement real-world transactions – Banking transaction – Airline reservation
Background image of page 2
3 Transaction: Programmer’s Role Consistent State Consistent State Transaction
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Transaction: System’s Role • Atomicity – All changes of the transaction recorded or none at all • Durability – All future transactions see the changes made by this transaction if it completes • Isolation – Net effect as if the transaction executed in isolation
Background image of page 4
5 Transaction: States Begin Run Abort Commit
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Transactions • Historical note: – Turing Award for Transaction concept – Jim Gray (1998) • Interesting reading: Transaction Concept: Virtues and Limitations by Jim Gray http://www.hpl.hp.com/techreports/tandem/TR-81.3.pdf
Background image of page 6
7 Context • We have seen: – Ensure atomicity in presence of failures • Next: – Ensure Isolation during concurrency
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 Issues with Concurrency: Example A = 500 B = 500 C = 500 Account Balances Bank database: 3 Accounts Property: A + B + C = 1500 Money does not leave the system
Background image of page 8
9 Issues with Concurrency: Example Read (A, t) t = t - 100 Write (A, t) Read (B, t) t = t + 100 Write (B, t) Transaction T1: Transfer 100 from A to B A = 400, B = 600, C = 500 A = 500, B = 500, C = 500
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
10 Issues with Concurrency: Example Read (A, s) s = s - 100 Write (A, s) Read (C, s) s = s + 100 Write (C, s) Transaction T2: Transfer 100 from A to C
Background image of page 10
Read (A, t) t = t - 100 Write (A, t) Read (B, t) t = t + 100 Write (B, t) Read (A, s) s = s - 100 Write (A, s) Read (C, s) s = s + 100 Write (C, s) Transaction T1 Transaction T2 A B C 400 600 600 500 500 500 400 500 500 400 500 500 400 500 600 400 + 600 + 600 = 1600
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Read (A, t) t = t - 100 Write (A, t) Read (B, t) t = t + 100 Write (B, t) Read (A, s) s = s - 100 Write (A, s) Read (C, s) s = s + 100 Write (C, s) Transaction T1 Transaction T2 A B C 300 600 600 500 500 500 400 500 500 300 500 500 300 500 600 300 + 600 + 600 = 1500
Background image of page 12
13 Terminology • Schedule: – The exact sequence of (relevant) actions of one or more transactions
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
14 Problems • Which schedules are “correct”?
Background image of page 14
Image of page 15
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 01/17/2012.

Page1 / 60

notes11 - CS216: Data-Intensive Computing Systems...

This preview shows document pages 1 - 15. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online