Concurrency in Databases

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/15

flashcard set

Earn XP

Description and Tags

This set of flashcards covers key concepts related to concurrency in databases, focusing on transaction management, locking mechanisms, and associated problems.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

16 Terms

1
New cards

What is the primary purpose of database concurrency?

To allow multiple users to access a database at the same time while preventing them from interfering with each other.

2
New cards

What mechanism is used in databases to manage access by multiple users?

Locks are used to prevent concurrent updates to the same data by multiple users.

3
New cards

What is a race condition in the context of databases?

A race condition occurs when two users try to access the same data simultaneously, leading to potential data corruption.

4
New cards

What are the ACID principles that transactions must follow?

Transactions must be Atomic, Consistent, Isolated, and Durable.

5
New cards

What does 'atomicity' mean in database transactions?

A transaction is an all-or-nothing operation; it either completes fully or not at all.

6
New cards

What does 'consistency preservation' ensure in transactions?

The database must remain in a valid state before and after each transaction.

7
New cards

What is meant by 'isolation' in transaction management?

Transactions must operate independently, without interference from others.

8
New cards

What does 'durability' mean regarding database transactions?

Once a transaction is committed, its changes should not be lost, even in case of a failure.

9
New cards

What must happen before a transaction can commit changes in a database?

All actions taken during the transaction must be written to disk.

10
New cards

What is a deadlock in the context of database transactions?

A deadlock occurs when two transactions block each other, each waiting for the other to release a lock.

11
New cards

What is the difference between 'wait-die' and 'wound-wait' deadlock prevention methods?

In 'wait-die', newer transactions abort if they request locks held by older ones. In 'wound-wait', older transactions abort if they request locks held by newer ones.

12
New cards

How does the database detect deadlocks?

By using a graph to represent transactions and their locks, spotting cycles indicates a deadlock.

13
New cards

What happens during a transaction rollback?

The database undoes all changes made during the transaction to revert to the previous state.

14
New cards

What is a locking hierarchy in database systems?

A system that allows locking at multiple levels, such as specific values, rows, tables, or the entire database.

15
New cards

How do databases manage to support multiple transactions concurrently?

By implementing locks and using mechanisms like read-write locks to control how users access data.

16
New cards

What is a 'dirty read' problem in databases?

A scenario where a transaction reads data that has been modified by another transaction but not yet committed.

Explore top flashcards