Distributed Database Management Systems: Lecture 28. The main topics covered in this chapter include: serializability theory; serializability theory in DDBS; equivalent schedules; serializable schedule; fragmented databases; replicated databases;...
Trang 1Distributed Database Management Systems
Lecture 28
Trang 2In the previous lecture
• Types of Transaction
• Transaction in DDBS
• Serial Transactions
• Conflicting Ops/Tr.
Trang 3In this Lecture
• Serializability Theory
• Serializability Theory in
DDBS.
Trang 4Equivalent 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
Trang 5• 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
Trang 6Serializable Schedule
Trang 7If it is conflict equivalent
to a serial schedule,
i.e., the final state in
which it leaves the
database is equivalent
to a serial
Trang 10• The function of the
Trang 11Fragmented Databases
Trang 12• The serializability is
straight forward
• Local transaction are
independent of each other; each concerns local data.
Trang 14transactions-Replicated Databases
Trang 15Read(x)
x = x + 5 Write(x) Commit
T2:
Read(x)
x = x*10 Write(x) Commit
Trang 16• All values of replicated
data should be same
1.Local Schedule same
2.Conflicting Ops in same relative order on all sites.
Trang 17• Logical and physical
data items
• User issues Ops on
logical data items
• Replica control maps
to physical ones-
Trang 19Concurrency Control Algorithms
Trang 21topology-• Synchronization primitive
is the most common
• Locking and Ordering
• Pessimistic & Optimistic.
Trang 22• Pessimistic approach
synchronizes
transactions early
• Optimistic do this late
in execution life cycle
of transactions
Trang 25• Optimistic
–Locking-based
–Timestamp based.
Trang 26ordering-Locking based Concurrency Control
Trang 27• Basic idea is that data
Trang 28• Two major types of
locks, read lock and write lock
• Transaction need to
apply lock first
Trang 30• Locking is job of
DDBMS, not the user
• Scheduler is the Lock
Manager
• TM and LM interact.