Distributed Transactions Management
Distributed Transactions Management
Basic Concepts of TM
Transaction management deals with the problem
Basic Concepts of TM
Database in a
consistent
state
Begin
Transaction
Database may be
temporarily in an
inconsistent state
during execution
Execution of
Transaction
Database in a
consistent
state
End
Transaction
Basic Concepts of TM
A transaction is made up of a sequence of read
Basic Concepts of TM
Abort/commit
Rollback
concurrency transparency
failure transparency
Basic Concepts of TM
Update employee salary by 20% for the employees
improved
Response time should be minimized
Availability should be maximized
Communication cost should be minimized
Principles of Transactions
ATOMICITY
all or nothing
CONSISTENCY
no violation of integrity constraints
ISOLATION
concurrent changes invisible serializable
DURABILITY
committed updates
Distributed persist
Database Systems
Atomicity
Either
Consistency
Internal consistency
A transaction which executes alone against a
10
Consistency Degrees
Degree 0
Transaction T does not overwrite dirty data of
other transactions
Dirty data refers to data values that have been
updated by a transaction prior to its commitment
Degree 1
T does not overwrite dirty data of other
transactions
T does not commit any writes before EOT
Distributed Database Systems
11
before T completes.
12
Isolation
Serializability
If
several
transactions
are
executed
concurrently, the results must be the same as if
they were executed serially in some order.
Incomplete results
An incomplete transaction cannot reveal its
its
13
Isolation Example
Consider the following two transactions:
T1:
Read(x)
x x+1
Write(x)
Commit
T2: Read(x)
x x+1
Write(x)
Commit
Read(x)
x x+1
Write(x)
Commit
Read(x)
x x+1
Write(x)
Commit
T1:
T1:
T2:
T1:
T2:
T2:
T1:
T2:
Read(x)
x x+1
Read(x)
Write(x)
x x+1
Write(x)
Commit
Commit
14
15
Anomaly Serializable
None of the phenomena
possible.
Distributed Databaseare
Systems
16
Durability
Once a transaction commits, the system
17
Transaction Structure
Flat transaction
Consists of a sequence of primitive operations embraced between
a begin and end markers.
Begin_transaction Reservation
end.
Nested transaction
The operations of a transaction may themselves be transactions.
Begin_transaction Reservation
Begin_transaction Airline
end. {Airline}
Begin_transaction Hotel
Nested Transactions
Have the same properties as their parents
may
themselves
transactions.
have
other
nested
19
Nested Transactions
Types
Closed nesting
Subtransactions begin after their parents and finish
before them.
Commitment of a subtransaction is conditional upon
can
execute
and
commit
independently.
Compensation may be necessary.
Distributed Database Systems
20
3. Recovery manager
Preserves the database in consistent state in case of failures
4. Buffer Manager
Efficient transfer of data between disk storage and main memory
Distributed Database Systems
22
23
25
26
27