Notes08 - CS 245 Database System Principles Notes 08...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 245 Notes 08 1 CS 245: Database System Principles Notes 08: Failure Recovery Steven Whang CS 245 Notes 08 2 PART II Crash recovery (1 lectures) Ch.17[17] Concurrency control (2 lectures) Ch.18[18] Transaction processing (1 lect) Ch.19[19] Information integration (1 lect) Ch.20[21,22] Entity resolution (1 lect) CS 245 Notes 08 3 Integrity or correctness of data • Would like data to be “accurate” or “correct” at all times EMP Name White Green Gray Age 52 3421 1 CS 245 Notes 08 4 Integrity or consistency constraints • Predicates data must satisfy • Examples: - x is key of relation R - x y holds in R - Domain(x) = {Red, Blue, Green} α is valid index for attribute x of R - no employee should make more than twice the average salary CS 245 Notes 08 5 Definition: • Consistent state: satisfies all constraints • Consistent DB: DB in consistent state CS 245 Notes 08 6 Constraints ( as we use here) may not capture “full correctness” Example 1 Transaction constraints • When salary is updated, new salary > old salary • When account record is deleted, balance = 0
Image of page 1

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

View Full Document Right Arrow Icon
CS 245 Notes 08 7 Note: could be “emulated” by simple constraints, e.g., account Acct # …. balance deleted? CS 245 Notes 08 8 Example 2 Database should reflect real world DB Reality Constraints ( as we use here) may not capture “full correctness” CS 245 Notes 08 9 in any case, continue with constraints... Observation: DB cannot be consistent always! Example: a 1 + a 2 +…. a n = TOT ( constraint ) Deposit $100 in a 2 : a 2 a 2 + 100 TOT TOT + 100 CS 245 Notes 08 10 a 2 TOT . . 50 . . 1000 . . 150 . . 1000 . . 150 . . 1100 Example: a 1 + a 2 +…. a n = TOT ( constraint ) Deposit $100 in a 2 : a 2 a 2 + 100 TOT TOT + 100 CS 245 Notes 08 11 Transaction: collection of actions that preserve consistency Consistent DB Consistent DB’ T CS 245 Notes 08 12 Big assumption: If T starts with consistent state + T executes in isolation T leaves consistent state
Image of page 2
CS 245 Notes 08 13 Correctness (informally) • If we stop running transactions, DB left consistent • Each transaction sees a consistent DB CS 245 Notes 08 14 How can constraints be violated? • Transaction bug • DBMS bug • Hardware failure e.g., disk crash alters balance of account • Data sharing e.g.: T1: give 10% raise to programmers T2: change programmers systems analysts CS 245 Notes 08 15 How can we prevent/fix violations? • Chapter 17[17]: due to failures only • Chapter 18[18]: due to data sharing only • Chapter 19[19]: due to failures and sharing CS 245 Notes 08 16 Will not consider: • How to write correct transactions • How to write correct DBMS • Constraint checking & repair That is, solutions studied here do not need
Image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern