1/15
This set of flashcards covers key concepts related to concurrency in databases, focusing on transaction management, locking mechanisms, and associated problems.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
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.
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.
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.
What are the ACID principles that transactions must follow?
Transactions must be Atomic, Consistent, Isolated, and Durable.
What does 'atomicity' mean in database transactions?
A transaction is an all-or-nothing operation; it either completes fully or not at all.
What does 'consistency preservation' ensure in transactions?
The database must remain in a valid state before and after each transaction.
What is meant by 'isolation' in transaction management?
Transactions must operate independently, without interference from others.
What does 'durability' mean regarding database transactions?
Once a transaction is committed, its changes should not be lost, even in case of a failure.
What must happen before a transaction can commit changes in a database?
All actions taken during the transaction must be written to disk.
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.
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.
How does the database detect deadlocks?
By using a graph to represent transactions and their locks, spotting cycles indicates a deadlock.
What happens during a transaction rollback?
The database undoes all changes made during the transaction to revert to the previous state.
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.
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.
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.