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

Distributed Database Management Systems: Lecture 28

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 (268.66 KB, 30 trang )

Distributed Database
Management Systems
Lecture 28


In the previous lecture
• Types of Transaction
• Transaction in DDBS
• Serial Transactions
• Conflicting Ops/Tr.


In this Lecture
• Serializability Theory
• Serializability Theory in
DDBS.


Equivalent Schedules
Two schedules S1, S2 defined
over same T are equivalent if
they have same effect on the
database, that is, leave
database in same final state.


• Formally, if for each pair of
conflicting operations Oij and
Okl (i ≠ k) if Oij <1 Okl then
Oij <2 Okl
• The phenomena is also


called conflict equivalence


Serializable Schedule


If it is conflict equivalent
to a serial schedule,
i.e., the final state in
which it leaves the
database is equivalent
to a serial schedule-


• Ss ={W2(x), W2(y), R2(z),
C2, R1(x), W1(x), C1,
R3(x), R3(y), R3(z), C3}
• S1 = {W2(x), R1(x), R3
(x),W1(x),C1, W2(y), R3(y),
R2(z),C2 ,R3(z), C3} No


• Ss ={W2(x), W2(y), R2(z),
C2, R1(x), W1(x), C1,
R3(x), R3(y), R3(z), C3}
• S2 ={W2(x), R1(x), W1(x),
C1, R3(x), W2(y), R3(y),
R2(z), C2, R3(z), C3} yes



• The function of the
concurrency controller
is to generate
serializable schedule
• Local and Global
Schedules.


Fragmented Databases


• The serializability is
straight forward.
• Local transaction are
independent of each other;
each concerns local data.


• In case of global
transactions
• Local subtransactions
will be treated as
different transactions-


Replicated Databases


T1:
Read(x)

x=x+5
Write(x)
Commit

T2:
Read(x)
x = x*10
Write(x)
Commit

LS1={R1(x), W1(x),C1, R2(x), W2(x), C2}
LS2={R2(x), W2(x), C2, R1(x), W1(x), C1}


• All values of replicated
data should be same
1.Local Schedule same
2.Conflicting Ops in same
relative order on all sites.


• Logical and physical
data items
• User issues Ops on
logical data items
• Replica control maps
to physical ones-


• ROWA Protocol

• Reduces availability in
case of failure
• Different alogos, different
replications.


Concurrency
Control Algorithms


• Different categorizations
possible
• Like, mode of
distribution, network
topology-


• Synchronization primitive
is the most common
• Locking and Ordering
• Pessimistic & Optimistic.


• Pessimistic approach
synchronizes
transactions early
• Optimistic do this late
in execution life cycle
of transactions



• Pessimistic
–Locking-based
•Centralized Locking
•Primary Copy Locking
•Distributed Locking-


• Pessimistic
–Timestamp Ordering (TO)
•Basic TO
•Multiversion TO
•Conservative TO

–Hybrid


• Optimistic
–Locking-based
–Timestamp orderingbased.


×