Transactions, Concurrency, & Isolation Flashcards
(75 cards)
What is a transaction in Databricks?
A transaction is a sequence of operations performed as a single logical unit of work, ensuring data integrity.
True or False: Databricks supports ACID transactions.
True
What does ACID stand for in the context of transactions?
Atomicity, Consistency, Isolation, Durability.
Fill in the blank: In Databricks, ________ ensures that transactions are processed reliably.
ACID properties
What is concurrency control?
Concurrency control is the management of simultaneous operations without conflicting with each other.
Which isolation level in Databricks prevents dirty reads?
Read Committed
Multiple Choice: Which of the following is NOT an isolation level supported by Databricks? A) Serializable B) Read Uncommitted C) Read Committed D) Snapshot
B) Read Uncommitted
What is the default isolation level in Databricks?
Serializable
True or False: Snapshot isolation allows for reading the last committed version of data.
True
What is the purpose of optimistic concurrency control in Databricks?
To allow multiple transactions to proceed without locking resources, checking for conflicts before committing.
Fill in the blank: In Databricks, ________ provides a mechanism to manage concurrent access to data.
Concurrency control
What happens during a rollback in a Databricks transaction?
All changes made during the transaction are undone.
Multiple Choice: Which of the following can lead to a deadlock? A) Two transactions locking the same resource B) One transaction waiting for a resource held by another C) Both A and B
C) Both A and B
What is the result of a dirty read?
Reading uncommitted changes made by another transaction.
True or False: Serializable isolation level can lead to increased contention.
True
What does the term ‘phantom read’ refer to?
When a transaction reads a set of rows that satisfy a condition, but another transaction inserts or deletes rows, causing the first transaction to see different data if it re-queries.
Fill in the blank: In Databricks, a ________ is a logical grouping of one or more SQL statements.
transaction
What is the purpose of the ‘BEGIN TRANSACTION’ statement?
To initiate a new transaction.
Multiple Choice: Which isolation level allows for non-repeatable reads? A) Read Committed B) Serializable C) Snapshot D) Read Uncommitted
A) Read Committed
What does the term ‘commit’ mean in a transaction?
To make all changes made during the transaction permanent.
True or False: Isolation levels can be changed during a transaction.
False
What is the difference between optimistic and pessimistic concurrency control?
Optimistic assumes conflicts are rare, while pessimistic locks resources to prevent conflicts.
Fill in the blank: A ________ is a sequence of operations that can be rolled back if not completed successfully.
transaction
What happens during a commit in a Databricks transaction?
All changes made during the transaction are saved and made visible to other transactions.