Concurrency Control - PowerPoint Presentation, Introduction to Database Systems Notes | EduRev

: Concurrency Control - PowerPoint Presentation, Introduction to Database Systems Notes | EduRev

 Page 1


1 
Introduction to Database Systems 
CSE 444 
 
Lectures 17-18: 
Concurrency Control 
May 12-14, 2008 
Page 2


1 
Introduction to Database Systems 
CSE 444 
 
Lectures 17-18: 
Concurrency Control 
May 12-14, 2008 
2 
Outline 
• Serial and Serializable Schedules (18.1) 
• Conflict Serializability (18.2) 
• Locks (18.3) 
• Multiple lock modes (18.4) 
• The tree protocol (18.7) 
• Concurrency control by timestamps 18.8 
• Concurrency control by validation 18.9 
Page 3


1 
Introduction to Database Systems 
CSE 444 
 
Lectures 17-18: 
Concurrency Control 
May 12-14, 2008 
2 
Outline 
• Serial and Serializable Schedules (18.1) 
• Conflict Serializability (18.2) 
• Locks (18.3) 
• Multiple lock modes (18.4) 
• The tree protocol (18.7) 
• Concurrency control by timestamps 18.8 
• Concurrency control by validation 18.9 
3 
The Problem 
• Multiple transactions are running concurrently 
T
1
, T
2
, … 
• They read/write some common elements 
A
1
, A
2
, … 
• How can we prevent unwanted interference ? 
 
The SCHEDULER is responsible for that 
Page 4


1 
Introduction to Database Systems 
CSE 444 
 
Lectures 17-18: 
Concurrency Control 
May 12-14, 2008 
2 
Outline 
• Serial and Serializable Schedules (18.1) 
• Conflict Serializability (18.2) 
• Locks (18.3) 
• Multiple lock modes (18.4) 
• The tree protocol (18.7) 
• Concurrency control by timestamps 18.8 
• Concurrency control by validation 18.9 
3 
The Problem 
• Multiple transactions are running concurrently 
T
1
, T
2
, … 
• They read/write some common elements 
A
1
, A
2
, … 
• How can we prevent unwanted interference ? 
 
The SCHEDULER is responsible for that 
4 
Three Famous Anomalies 
What can go wrong if we didn’t have 
concurrency control: 
 
• Dirty reads 
• Lost updates 
• Inconsistent reads 
Many other things may go wrong, but have no names 
Page 5


1 
Introduction to Database Systems 
CSE 444 
 
Lectures 17-18: 
Concurrency Control 
May 12-14, 2008 
2 
Outline 
• Serial and Serializable Schedules (18.1) 
• Conflict Serializability (18.2) 
• Locks (18.3) 
• Multiple lock modes (18.4) 
• The tree protocol (18.7) 
• Concurrency control by timestamps 18.8 
• Concurrency control by validation 18.9 
3 
The Problem 
• Multiple transactions are running concurrently 
T
1
, T
2
, … 
• They read/write some common elements 
A
1
, A
2
, … 
• How can we prevent unwanted interference ? 
 
The SCHEDULER is responsible for that 
4 
Three Famous Anomalies 
What can go wrong if we didn’t have 
concurrency control: 
 
• Dirty reads 
• Lost updates 
• Inconsistent reads 
Many other things may go wrong, but have no names 
5 
Dirty Reads 
T
1
:  WRITE(A)  
 
 
T
1
:  ABORT 
  
T
2
:  READ(A) 
 
 
Read More
Offer running on EduRev: Apply code STAYHOME200 to get INR 200 off on our premium plan EduRev Infinity!