Distributed Transactions Flashcards
What are Transactions?
A transaction is a set of related sequential operations that is guaranteed by the server to be atomic in the presence of multiple clients and server crashes.
What are the Properties of database transactions intended to guarantee data validity?
-Atomicity: a transaction should be all or nothing
-Consistency: a transaction takes the system from one consistent state to another consistent state.
-Isolation: each transaction must be performed without interference.
-Durability: After a transaction has completed successfully, all its effects are saved in permanent storage.
Locking is a concurrency control method. How does it work?
-Locks regulate access and ensure transaction isolation and data consistency.
-Lock set on each object just before it is accessed.
-Lock is labelled with the transaction identifier.
-Only the transaction that holds the lock can access the object.
-Locks removed when the transaction has completed.
-Can lead to deadlocks.
What is Optimistic Concurrency Control?
-OCC transactions proceed optimistically assuming that conflicts are rare.
-It allows multiple transactions to proceed concurrently without blocking each other.
What are the steps of OCC?
1.Set up
2.Read phase
3. Validation Phase
4.Commit Phase
What are Timestamp Ordering steps?
1.Timestamp assignment.
2.Read and write operations.
3.Validation phase.
4.Commit or Abort.
What are Dirty Reads?
A dirty read occurs when one transaction reads data that has been modified by another transaction that has not yet been comitted.
What are Premature Writes?
A premature write is when multiple transactions attempt to write the same object or data item.