CONCURRENCY CONTROL THE CASE FOR INVARIANT-BASED Peter Bailis UC Berkeley with Alan Fekete, Mike Franklin, Ali Ghodsi, Ion Stoica, Joe Hellerstein CIDR 2015 Gong Show 5 January 2015, Pacific Grove, CA
READ COMMITTED G0: Write Cycles. A history H exhibits phenomenon G0 if DSG(H) contains a directed cycle consisting entirely of write-dependency edges. G1a: Aborted Reads. A history H shows phenomenon G1a if it contains an aborted transaction T1 and a committed transaction T2 such that T2 has read some object (maybe via a predicate) modified by T1. G1b: Intermediate Reads. A history H shows phenomenon G1b if it contains a committed transaction T2 that has read a version of object x (maybe via a predicate) written by transaction T1 that was not T1’s final modification of x. G1c: Circular Information Flow. A history H exhibits phenomenon G1c if DSG(H) contains a directed cycle consisting entirely of dependency edges. [Atul Adya’s Ph.D, 1999]
READ COMMITTED G0: Write Cycles. A history H exhibits phenomenon G0 if DSG(H) contains a directed cycle consisting entirely of write-dependency edges. G1a: Aborted Reads. A history H shows phenomenon G1a if it contains an aborted transaction T1 and a committed transaction T2 such that T2 has read some object (maybe via a predicate) modified by T1. G1b: Intermediate Reads. A history H shows phenomenon G1b if it contains a committed transaction T2 that has read a version of object x (maybe via a predicate) written by transaction T1 that was not T1’s final modification of x. G1c: Circular Information Flow. A history H exhibits phenomenon G1c if DSG(H) contains a directed cycle consisting entirely of dependency edges. [Atul Adya’s Ph.D, 1999] Highly nuanced, very technical, sometimes incomplete!
1.) Are easier to reason about than weak isolation Invariants: “usernames should be unique” “each patient should have a attending doctor” “account balances should be positive”
1.) Are easier to reason about than weak isolation 2.) Are already specified in many applications Invariants: “usernames should be unique” “each patient should have a attending doctor” “account balances should be positive”
1.) Are easier to reason about than weak isolation 2.) Are already specified in many applications Invariants: “usernames should be unique” “each patient should have a attending doctor” “account balances should be positive”
Foreign Key Constraints YES Primary Key Constraints YES Row-Level Check Constraints YES Multi-Row Check Constraints NO Generic ADT Invariants NO UDF Invariants NO DB supported invariants today: & little support for distributing, suggesting, mining invariants
1.) Are easier to reason about than weak isolation 2.) Are already specified in many applications 3.) Should be a first-class database primitive 4.) Enable more efficient systems design Invariants:
1.) Are easier to reason about than weak isolation 2.) Are already specified in many applications 3.) Should be a first-class database primitive 4.) Enable more efficient systems design Invariants:
1.) Are easier to reason about than weak isolation 2.) Are already specified in many applications 3.) Should be a first-class database primitive 4.) Enable more efficient systems design Invariants:
1.) Are easier to reason about than weak isolation 2.) Are already specified in many applications 3.) Should be a first-class database primitive 4.) Enable more efficient systems design Invariants:
1.) Are easier to reason about than weak isolation 2.) Are already specified in many applications 3.) Should be a first-class database primitive 4.) Enable more efficient systems design Invariants: We can do so much better than weak isolation
Image Credits: world by Wayne Tyler Sall surprised by Julian Deveaux database by Austin Condiff man by Simon Child by the Noun Project Creative Commons - Attribution (CC by 3.0)