Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Database Management Systems: Chapter 5 - Concurrency Control Techniques provides about Databases Concurrency Control (Purpose of Concurrency Control, Two-Phase locking, Concurrency control based on Timestamp ordering, Multiversion Concurrency Control techniques, Lock Compatibility Matrix, Lock Granularity). | Chapter 5 Concurrency Control Techniques Adapted from the slides of “Fundamentals of Database Systems” (Elmasri et al., 2003) Outline Databases Concurrency Control 1 Purpose of Concurrency Control 2 Two-Phase locking 3 Concurrency control based on Timestamp ordering 4 Multiversion Concurrency Control techniques 5 Lock Compatibility Matrix 6 Lock Granularity Database Concurrency Control 1 Purpose of Concurrency Control To enforce Isolation (through mutual exclusion) among conflicting transactions. To preserve database consistency through consistency preserving execution of transactions. To resolve read-write and write-write conflicts. Example: In concurrent execution environment if T1 conflicts with T2 over a data item A, then the existing concurrency control decides if T1 or T2 should get the A and if the other transaction is rolled-back or waits. Database Concurrency Control Two-Phase Locking Techniques Locking is an operation which secures (a) permission to Read or (b) . | Chapter 5 Concurrency Control Techniques Adapted from the slides of “Fundamentals of Database Systems” (Elmasri et al., 2003) Outline Databases Concurrency Control 1 Purpose of Concurrency Control 2 Two-Phase locking 3 Concurrency control based on Timestamp ordering 4 Multiversion Concurrency Control techniques 5 Lock Compatibility Matrix 6 Lock Granularity Database Concurrency Control 1 Purpose of Concurrency Control To enforce Isolation (through mutual exclusion) among conflicting transactions. To preserve database consistency through consistency preserving execution of transactions. To resolve read-write and write-write conflicts. Example: In concurrent execution environment if T1 conflicts with T2 over a data item A, then the existing concurrency control decides if T1 or T2 should get the A and if the other transaction is rolled-back or waits. Database Concurrency Control Two-Phase Locking Techniques Locking is an operation which secures (a) permission to Read or (b) permission to Write a data item for a transaction. Example: Lock(X). Data item X is locked in behalf of the requesting transaction. Unlocking is an operation which removes these permissions from the data item. Example: Unlock(X). Data item X is made available to all other transactions. Lock and Unlock are atomic operations. Database Concurrency Control Two-Phase Locking Techniques: Essential components Two locks modes (a) shared (read) and (b) exclusive (write). Shared mode: shared lock (X). More than one transaction can apply share lock on X for reading its value but no write lock can be applied on X by any other transaction. Exclusive mode: Write lock (X). Only one write lock on X can exist at any time and no shared lock can be applied by any other transaction on X. Conflict matrix Database Concurrency Control Two-Phase Locking Techniques: Essential components Lock Manager: Managing locks on data items. Lock table: Lock manager uses it to store the identity of transaction locking