Discuss different methods for concurrency control Flashcards

1
Q
  1. what is a locking method.
A

is placing locks on database objects (e.g. rows, tables) to prevent concurrent transactions from accessing or modifying the same data simultaneously.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Lock granularity (level or lock use). - Database-Level lock

A
  1. Database-level: restricts access to the owner of the lock and allows only one user at a time to access the database.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Lock granularity (level or lock use). - Table-Level lock

A
  1. Table-level: allows only one transaction at a time to access a table.
  2. Page-level: an entire diskpage or section of a disk is locked.
  3. Row-level: concurrent transaction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Lock granularity (level or lock use). - Page-Level lock

A
  1. Page-level: an entire diskpage or section of a disk is locked.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Lock granularity (level or lock use). - Row-Level lock

A
  1. Row-level: concurrent transactions to access the same rows of the same table, even if the rows are on the same page.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Lock granularity (level or lock use). - Field-Level lock

A
  1. Field-level: allows concurrent transactions to access the same rows as they require the use of different attributes within that row.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Lock types - Binary Lock.

A
  1. Binary lock - has only two states, locked (1) and unlocked (0). if a data item is locked, no other transaction can use that data item.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Lock types - Exclusive lock.

A

Issued when a transactions must update or (WRITE) a data item, an exclusive lock is requested, its application for a lock will not proceed until all locks are released.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Lock types - Shared lock.

A

multiple processes can simultaneously hold shared locks to enable them to read without updating.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is a deadlock

A

occurs when two transactions wait indefinitely for each other to unlock data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Deadlock Control Techniques. - Avoidance

A

Avoidance - transaction must obtain all the locks needed before it can be executed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Deadlock Control Techniques. - Prevention

A

Prevention - transaction requesting a new lock is aborted when there is a possibility that a deadlock can occur.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Deadlock Control Techniques. - Detection

A

Detection - DBMS tests database periodically for deadblocks, if found, victim transaction is aborted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what is two-phase locking.

A

2PL - A set of rules that manage how transactions acquire and release locks to ensure serializability, though it doesnt prevent deadlocks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

2PL - Growing Phase.

A

The transaction acquires all the locks it needs without releasing any.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

2PL - Shrinking Phase.

A

After reaching its locked point (where all necessary locks are obtained), the transaction releases its locks and cannot acquire new ones.

17
Q
  1. What is timestamping
A

Time stamping: Assigns a global unique time stamp to each transaction.

18
Q

Time stamping properties - Uniqueness

A

Ensures no equal time stamp values exist

19
Q

Time stamping properties - Monotonicity

A

Ensures time stamp values always increased

20
Q
  1. what is Optimistic methods
A

Optimistic approach: Assumes that most database operations do not conflict.