PDC Lecture 3-4 Transactions
PDC Lecture 3-4 Transactions
Lecture – 03 Week – 02
INSTRUCTOR: MUHAMMAD ARSALAN RAZA
2
Preamble
Distributed Systems
Parallel Computing
Introduction to transactions
The Transaction Model
A.C.I.D
Types of Transactions
Nested Transactions vs. Distributed Transactions
Write-ahead Log
Concurrency Control
Serializability
Lahore Garrison University Updating a master tape is fault tolerant.
6
The Transaction Model (Cont.)
Primitive Description
BEGIN_TRANSACTION BEGIN_TRANSACTION
reserve WP -> JFK; reserve WP -> JFK;
reserve JFK -> Nairobi; reserve JFK -> Nairobi;
reserve Nairobi -> Malindi; reserve Nairobi -> Malindi full =>
END_TRANSACTION ABORT_TRANSACTION
(a) (b)
Flat Transaction: this is the model that we have looked at so far. Disadvantage:
too rigid. Partial results cannot be committed. That is, the “atomic” nature of Flat
Transactions can be a downside.
Nested Transaction: a main, parent transaction spawns child sub-transactions to
do the real work. Disadvantage: problems result when a sub-transaction commits
and then the parent aborts the main transaction. Things get messy.
Distributed Transaction: this is sub-transactions operating on distributed data
stores. Disadvantage: complex mechanisms required to lock the distributed data,
as well as commit the entire transaction.
a) A transaction
b) – d) The log before each statement is executed
Lahore Garrison University
14
Concurrency Control
Schedule 1 x = 0; x = x + 1; x = 0; x = x + 2; x = 0; x = x + 3 Legal
Schedule 2 x = 0; x = 0; x = x + 1; x = x + 2; x = 0; x = x + 3; Illegal
Schedule 3 x = 0; x = 0; x = x + 1; x = 0; x = x + 2; x = x + 3; Illegal
(d)
Introduction to transactions
The Transaction Model
A.C.I.D
Types of Transactions
Nested Transactions vs. Distributed Transactions
Private Workspace
Writeahead Log
Concurrency Control
Serializability
To cover this topic, different reference material has been used for
consultation.
Textbook: