Explore tens of thousands of sets crafted by our community.
Database Locking Mechanisms
8
Flashcards
0/8
Pessimistic Locking
Locks data when a transaction begins to prevent concurrent modifications. Use when high contention is expected.
Optimistic Locking
Assumes multiple transactions can complete without affecting each other, and checks at commit time. Use when read operations are more common than writes.
Two-Phase Locking (2PL)
Guarantees serializability by acquiring all locks before any are released. Use for maintaining transaction consistency.
Deadlock Detection
Algorithm to identify deadlocks. Use when deadlock prevention is not feasible or practical.
Time Stamp Ordering
Assigns timestamps to ensure transactions are processed in a certain order. Use to avoid serialization anomalies.
Multiple Granularity
Allows transactions to lock resources at various levels of granularity. Use for efficiency when transactions need various types of access to data.
Read Committed Isolation
Allows reading only committed data, preventing dirty reads. Use this in databases where reading uncommitted data is not acceptable.
Serializable Isolation
Ensures transactions execute with the same effect as if they were executed serially. Use when absolute consistency is necessary.
© Hypatia.Tech. 2024 All rights reserved.