Upload
conan
View
36
Download
4
Embed Size (px)
DESCRIPTION
Lazy Database Replication with Snapshot Isolation. Khuzaima Daudjee [email protected] Joint work with Kenneth Salem David R. Cheriton School of Computer Science. Centralized System. Replicated System. Database Replication. transactions. transactions. transactions. DB. DB. DB. - PowerPoint PPT Presentation
Citation preview
Khuzaima Daudjee - VLDB 2006 1
Lazy Database Replication with Snapshot Isolation
Khuzaima [email protected]
Joint work with Kenneth Salem
David R. Cheriton School of Computer Science
Khuzaima Daudjee - VLDB 2006 2
Database Replication
Centralized System
DBDB DB
transactionstransactions transactions
Replicated System
Khuzaima Daudjee - VLDB 2006 3
Eager vs. Lazy Replication
Eager Protocols Lazy Protocols
R1
R2
T1
R1
R2
T1
T2
Khuzaima Daudjee - VLDB 2006 4
Transaction Isolation vs. Performance
Performance
Isolation LevelStrong Isolation
Low Performance
Weak Isolation
High Performance
Khuzaima Daudjee - VLDB 2006 5
Snapshot Isolation (SI)
time
commit(T1) start(T2)start(T2) commit(T2)
R[x]W[x]R[x] W[x]
→ SI allows any earlier database state to be seen
Khuzaima Daudjee - VLDB 2006 6
Concurrent Transactions Under SI
• Two transactions that write at least one common data item
• First-Committer-Wins (FCW) ruletime
commit(T1)start(T1)
T2
R[y] W[x]
R[x] W[y]
W[y]
Khuzaima Daudjee - VLDB 2006 7
Replica Inconsistency Under SI
time
T1
T2
T3
Site S2Site S1
T1
T3 sees commit(T1)
and commit(T2) DB state
T3
time
T2
T3 sees only commit(T1) DB state
Khuzaima Daudjee - VLDB 2006 8
Replica Consistency: a sequential solution
time
T1 T2
T3 sees commit(T2)
and commit(T1) DB state
T3
sequential order does not leverage weaker isolation level
At every replicated site:
Khuzaima Daudjee - VLDB 2006 9
Transaction Inversion
T2 = Status T1 = Reserve
client
DB DB
T1T2
T1’s update
Lazy Replicated System
Khuzaima Daudjee - VLDB 2006 11
Strong SI and Scalability
T2 = Status T1 = Reserve
client
T1T2
Lazy Replicated System
Khuzaima Daudjee - VLDB 2006 12
Strong Session SI
time
commit(T1) start(T3)commit(T2)
strong session SI imposes constraints
between start and commit operations
within a session
client session A
client session B
start(T3)
Khuzaima Daudjee - VLDB 2006 13
Lazy Master Architecture
Update Transactions
Lazy UpdatePropagation
Clients
Primary Site
Secondary Sites
(orders updates)
Khuzaima Daudjee - VLDB 2006 14
Transaction Relationships
→ start(T1) < commit(T2)
→ commit(T2) < start(T3)• start(T1) < commit(T2) < start(T3)• commit(T1) < commit(T2)
time
T2
T1
commit(T2)commit(T1)
T3
Khuzaima Daudjee - VLDB 2006 15
Global SIClients
Primary SiteSecondary Site
trans
propagate in timestamp
order
T1schedule updates
in order of start and commit ops
Khuzaima Daudjee - VLDB 2006 16
Enforcing Strong Session SI
• Each secondary database state tracks the primary database state
→ completeness [Zhuge et al]
• Inversions are possible since secondary DB state may lag behind
• Session guarantees need to be enforced by ensuring that transaction T2 sees the database state installed by T1
Khuzaima Daudjee - VLDB 2006 17
Algorithm Strong Session SI
ClientPrimary SiteSecondary Site
T1
T1’s updateT2
T1
block
?
Khuzaima Daudjee - VLDB 2006
Summary
• Global SI in lazy replicated systems: fully leverage concurrency controls to maintain consistent replicas
• Strong session SI: a useful and practical way to avoid transaction inversions in lazy replicated database systems
• Architecture and algorithms for global SI, strong SI and strong session SI in lazy replicated systems