Download presentation
Presentation is loading. Please wait.
1
Distributed Database Management Systems
Lecture 28
2
In the previous lecture
Types of Transaction Transaction in DDBS Serial Transactions Conflicting Ops/Tr.
3
In this Lecture Serializability Theory Serializability Theory in DDBS.
4
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.
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
6
Serializable Schedule
7
If it is conflict equivalent to a serial schedule, i. e
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-
8
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
9
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
10
The function of the concurrency controller is to generate serializable schedule
Local and Global Schedules.
11
Fragmented Databases
12
The serializability is straight forward.
Local transaction are independent of each other; each concerns local data.
13
In case of global transactions
Local subtransactions will be treated as different transactions-
14
Replicated Databases
15
T1: T2: Read(x) x = x + 5 Write(x) Commit x = x*10
LS1={R1(x), W1(x),C1, R2(x), W2(x), C2} LS2={R2(x), W2(x), C2, R1(x), W1(x), C1}
16
All values of replicated data should be same
Local Schedule same Conflicting Ops in same relative order on all sites.
17
Logical and physical data items
User issues Ops on logical data items Replica control maps to physical ones-
18
ROWA Protocol Reduces availability in case of failure Different alogos, different replications.
19
Concurrency Control Algorithms
20
Different categorizations possible
Like, mode of distribution, network topology-
21
Synchronization primitive is the most common
Locking and Ordering Pessimistic & Optimistic.
22
Pessimistic approach synchronizes transactions early
Optimistic do this late in execution life cycle of transactions
23
Pessimistic Locking-based Centralized Locking Primary Copy Locking
Distributed Locking-
24
Pessimistic Timestamp Ordering (TO) Hybrid Basic TO Multiversion TO
Conservative TO Hybrid
25
Optimistic Locking-based Timestamp ordering-based.
26
Locking based Concurrency Control
27
Basic idea is that data items accessed by conflicting operations are accessed by one operation at a time Data Items locked by Lock Manager
28
Two major types of locks, read lock and write lock
Transaction need to apply lock first.
29
For improved accessibility, compatibility of locks to be established
rli(x) wli(x) rlj(x) Yes No wlj(x)
30
Locking is job of DDBMS, not the user
Scheduler is the Lock Manager TM and LM interact.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.