Distributed Transactions Flashcards
What is a transaction?
Sequence of server operations guarenteed to be completed.
How do transactions comply to ACID?
Atomicity: Transactions are either completed or aborted.
Consistency: 1 consistent state to another.
Isolation: Transactions happen without interference from other transactions.
Durability: Results of transactions stored in permanent storage.
Why must objects be recoverable?
If a process crashes during a transactions, a new process can recover the objects from storage and continue the transaction.
Why must operations be synchronised?
To ensure isolation
When can transactions happen concurrently?
When concurrent execution has the same effect as serial execution.
What is the lost update problem?
Transaction T reads the value of x. (suspends) Transaction U reads the value of x. Transaction U adds 4 to value of x. Transaction U commits. Transaction T adds 5 to old value of x. Transaction T commits. Changes made by U are overridden.
What is the inconsistent retrieval problem?
Wrong retrieval of data because a transactipon accesses data before another has finished modifying it. (T) a.withdraw(100):100 (U) total = a.get(): 100 (U) total += b.get(): 400 (T) b.deposit(100):400 (T) commit (U) commit
What is a conflicting operation?
A pair of operations that, when executed in different orders, produce different values.
(Read->Write != Write-> Read)
What does serial equivalence require?
All conflicting operations to be executed in the same order for all processes.
What is locking?
Using locks to ensure that only one transaction can access data at any one time.
What can locking lead to?
Deadlock
What is optimistic concurrency?
Executing both transactions and checking for conflicts before commiting. If conflicts are found, both transactions are aborted.
What is timestamp ordering?
Using total ordering of transactions based on start.
If object O was last read/written by EARLIER transactions, O can be written to.
If O was last written to by EARLIER transactions, O can be read.
How are dirty reads prevented?
Delay commit of U until all transactions from which U has observed a value have also committed.
How can cascading aborts be prevented?
Only allow reads from commited transactions.