Tải bản đầy đủ (.pdf) (39 trang)

Distributed Database Management Systems: Lecture 27

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (281.94 KB, 39 trang )

Distributed Database
Management Systems
Lecture 27


In the previous lecture

• Defined Transaction
Formally
• ACID Properties of a
Transaction


In this Lecture
• ACID Properties
• Types of Transaction
• Transaction in DDBS


• Isolation and consistency
are interrelated, one
supports other
• Degree 3 provides full
isolation
• SQL-92 identified
isolation levels based on
following phenomena.


–Dirty Read: A transaction
reads the written value of


another transaction before
its commitment, like,
--, W1(x), ----, R2(x), --,C1(or A1)-----, C2(or A2).


–Non-repeatable or Fuzzy
Read: Two reads of same
data item by same Tr and
a write by another Tr on
the same data item
--, R1(x), ----, W2(x), --,C2-----, R1(x)----


Phantom: T1 performs
a read on a predicate,
T2 inserts tuples that
satisfy the predicate
--, R1(P), ----, W2(yinP),
--- ,C2(orA2)-----, C1(orA1)---


• Isolation levels

–Read Uncommitted: all three
phenomena possible
–Read Committed: fuzzy read,
phantoms possible; DR not
possible
–Repeatable Read: Only
phantoms possible

–Anomaly Serializable: None of
the phenomena possible


4- Durability:
• Once committed, changes
to DB are permanent.


Types of Transactions


• Timing
–on-line (short-life) vs batch
(long-life)

• Structure
–flat (or simple)
transactions
–nested transactions.


• Organization of read
and write actions
– two-step (all reads before
any write)
– Restricted (Read an item
before write)
– action model (Read/write
on an item to be atomic.



• 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}

end {Reservation}


Nested Transactions

• Have the same properties

as their parents; may
themselves have other
nested transactions.
• Introduces concurrency
control and recovery
concepts within the
transaction.


• Closed nesting

–Sub transactions begin after their
parents and finish before them
–Commitment of a sub transaction
is conditional upon the
commitment of the parent
(commitment through the root)

• Open nesting

–Sub transactions can execute and
commit independently.
–Compensation may be necessary.


Workflows


• Flat transaction model
suits relatively small

and simple
environments
• Certain environments
need combination of
open and nested
models.


• A candidate definition
“ a collection of tasks
organized to
accomplish some
business activity”
• Different types of
workflows.


Workflows generally
involve long transactions,
like a reservation
transaction that may
include Airline, Hotel,
Auto reservations and bill
generation.


• Workflows exhibit
open nesting
semantics
• So permits access to

the results of subactivity before the
commitment of the
major activity.


Some components are
declared as vital, main
activity aborts if a vital
component aborts,
otherwise it may
commit even if a nonvital component
aborts, like….


• Compensating
Transactions
• Contingency
Transactions.


Architecture Revisited


Begin Transaction, 
Read
Write, Commit, Abort

Results

Distributed Execution 

Monitor
With other
SCs
With other
TMs

Transaction Manager
Coordinates transactions exec

Scheduler
Sched/De­Sched requests

With other
Data processors


×