1. Trang chủ
  2. » Công Nghệ Thông Tin

Distributed Database Management Systems: Lecture 29

49 2 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 49
Dung lượng 114,05 KB

Nội dung

Distributed Database Management Systems: Lecture 29. The main topics covered in this chapter include: locking based CC; timestamp ordering based CC; TM sends ops and other information to LM; LM checks the status of data item;...

Distributed Database Management Systems Lecture 29 In the previous lecture • Serializability Theory • Serializability Theory in DDBS In this Lecture • Locking based CC • Timestamp ordering based CC • TM sends ops and other information to LM • LM checks the status of data item • Already Locked or not T1: Read(x) T2: Read(x) x = x+1 Write(x) Commit x = x*2 Write(x) Commit Read(y) Read(y) y = y-1 y = y*2 Write(y) Write(y) Commit Commit S={wl1(x), R1(x), W1(x), lr1(x), wl2(x), R2(x), W2(x), lr2(x), wl2(y), R2(y), W2(y), lr2(y), C2,wl1(y), R1(y), W1(y), lr1(y), C1) S={wl1(x), R1(x), W1(x), lr1(x), wl2(x), R2(x), W2(x), lr2(x), wl2(y), R2(y), W2(y), lr2(y), C2,wl1(y), R1(y), W1(y), lr1(y), C1) • Not a serial schedule • Problem: Locks released immediately- Two-Phase Locking • A transaction must not attain a lock once it releases a lock • Or, it should not release any lock until it is sure it won’t need any lock • It creates growing phase, shrinking phase and a lock point • Lock point determines end of growing phase and start of shrinking phase Any transaction that follows 2-PL is serializable • Read operation is performed from appropriate version • Write is rejected if any older has read or written a data item That was all about Pessimistic CC algorithms, now we move to Optimistic approaches Pessimistic assume that conflicts are likely to happen so they are careful and follow… Validate Read Compute Write Optimistic assumes less chances of conflict, so validation is done at the last stage… Read Compute Validate Write • Each transaction is divided into sub-transactions that execute independently • Tij = Tr i that executes at site j • Transactions run independently at each site until they reach end of read phases • All sub-transactions are assigned timestamps at the end of read phases • After that Validation test is performed • VT1: If all transactions Tk, where ts(Tk)

Ngày đăng: 05/07/2022, 13:40

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN