Distributed DBMSPage 10-12. 1© 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.

Slides:



Advertisements
Similar presentations
Outline Introduction Background Distributed Database Design
Advertisements

Transaction Models of DDBMS Zsolt Németh Topics covered: –Transactions –Characterization of transactions –Formalization of transactions –Serializability.
TRANSACTION PROCESSING SYSTEM ROHIT KHOKHER. TRANSACTION RECOVERY TRANSACTION RECOVERY TRANSACTION STATES SERIALIZABILITY CONFLICT SERIALIZABILITY VIEW.
Principles of Transaction Management. Outline Transaction concepts & protocols Performance impact of concurrency control Performance tuning.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Transaction Management Overview. Transactions Concurrent execution of user programs is essential for good DBMS performance. –Because disk accesses are.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
10 1 Chapter 10 Transaction Management and Concurrency Control Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Transaction Management and Concurrency Control
Transaction Management and Concurrency Control
Distributed DBMSPage 5. 1 © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture  Distributed Database.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Optimistic CC Performance Evaluation Criterion 1. Degree of Concurrency Less reshuffle  High degree of concurrency 2. Resources used to recognize - Lock.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Session - 14 CONCURRENCY CONTROL CONCURRENCY TECHNIQUES Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:
Transaction Management
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Distributed DBMSPage 5. 1 © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture  Distributed Database.
9 Chapter 9 Transaction Management and Concurrency Control Hachim Haddouti.
Optimistic Concurrency Control Merger of Semi-Committed Transactions From Several Partitions Combine DCG, DCG 2, --- DCG N (minimize rollback if cycle.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
System Catalogue v Stores data that describes each database v meta-data: – conceptual, logical, physical schema – mapping between schemata – info for query.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Transaction Management Overview Chapter 16.
Multi-user Database Processing Architectures Architectures Transactions Transactions Security Security Administration Administration.
Transaction Processing Concepts
1 Transaction Management Overview Chapter Transactions  Concurrent execution of user programs is essential for good DBMS performance.  Because.
Database Management Systems, 2 nd Edition. R. Ramakrishnan and J. Gehrke1 Transaction Management Overview Chapter 18.
Lecture 11 Distributed Transaction Management. Concurrency Control The problem of synchronizing concurrent transactions such that the consistency of the.
Distributed DBMS© 2001 M. Tamer Özsu & Patrick Valduriez Page 0.1 Outline Introduction Background Distributed DBMS Architecture Distributed Database Design.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 10 Transaction Management.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
CS 162 Discussion Section Week 9 11/11 – 11/15. Today’s Section ●Project discussion (5 min) ●Quiz (10 min) ●Lecture Review (20 min) ●Worksheet and Discussion.
Formal-Concurrency-Control General Comments Information needed by Concurrency Controllers –Locks on database objects (System-R, Ingres, Rosenkrantz…) –Time.
1 IRU Concurrency, Reliability and Integrity issues Geoff Leese October 2007 updated August 2008, October 2009.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Replicated Databases. Reading Textbook: Ch.13 Textbook: Ch.13 FarkasCSCE Spring
Computer Science Lecture 13, page 1 CS677: Distributed OS Last Class: Canonical Problems Election algorithms –Bully algorithm –Ring algorithm Distributed.
Transactions and Concurrency Control. Concurrent Accesses to an Object Multiple threads Atomic operations Thread communication Fairness.
Introduction.  Administration  Simple DBMS  CMPT 454 Topics John Edgar2.
1 CSE 480: Database Systems Lecture 24: Concurrency Control.
Introduction to Distributed Databases Yiwei Wu. Introduction A distributed database is a database in which portions of the database are stored on multiple.
1 Advanced Database Concepts Transaction Management and Concurrency Control.
9 1 Chapter 9_B Concurrency Control Database Systems: Design, Implementation, and Management, Rob and Coronel.
Multidatabase Transaction Management COP5711. Multidatabase Transaction Management Outline Review - Transaction Processing Multidatabase Transaction Management.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
1 Controlled concurrency Now we start looking at what kind of concurrency we should allow We first look at uncontrolled concurrency and see what happens.
18 September 2008CIS 340 # 1 Last Covered (almost)(almost) Variety of middleware mechanisms Gain? Enable n-tier architectures while not necessarily using.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Outline Introduction Background Distributed DBMS Architecture
General Comments Information needed by Concurrency Controllers
Transaction Properties
Outline Introduction Background Distributed DBMS Architecture
Outline Introduction Background Distributed DBMS Architecture
Chapter 10 Transaction Management and Concurrency Control
Outline Introduction Background Distributed DBMS Architecture
Outline Introduction Background Distributed DBMS Architecture
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Transaction Management
C. Faloutsos Transactions
Distributed Optimistic Algorithm
Optimistic CC Performance
Outline Introduction Background Distributed DBMS Architecture
Outline Introduction Background Distributed DBMS Architecture
Transactions, Properties of Transactions
Presentation transcript:

Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database Design Distributed Query Processing Distributed Transaction Management  Transaction Concepts and Models  Distributed Concurrency Control  Distributed Reliability n Building Distributed Database Systems (RAID) Mobile Database Systems Privacy, Trust, and Authentication Peer to Peer Systems

Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Useful References J. D. Ullman, Principles of Database Systems. Computer Science Press, Rockville, 1982 J. Gray and A. Reuter. Transaction Processing - Concepts and Techniques. Morgan Kaufmann, 1993 B. Bhargava, Concurrency Control in Database Systems, IEEE Trans on Knowledge and Data Engineering,11(1), Jan.-Feb. 1999

Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Concurrency Control Interleaved execution of a set of transactions that satisfies given consistency constraints. Concurrency Control Mechanisms: Locking (two-phase locking) Conflict graphs Knowledge about incoming transactions or transaction typing Optimistic: requires validation (backout and starvation) Some Examples: Centralized locking Distributed locking Majority voting Local and centralized validation

Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Basic Terms for Concurrency Control Database Database entity (item, object) Distributed database Program Transaction, read set, write set Actions Atomic Concurrent processing Conflict Consistency Mutual consistency History Serializability Serial history

Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Serializable history Concurrency control Centralized control Distributed control Scheduler Locking Read lock, write lock Two phase locking, lock point Crash Node failure Network partition Log Live lock Dead lock Conflict graph (Acyclic) Timestamp Version number Rollback Validation and optimistic Commit Redo log Undo log Recovery Abort Basic Terms for Concurrency Control

Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Concurrency Control once again The problem of synchronizing concurrent transactions such that the consistency of the database is maintained while, at the same time, maximum degree of concurrency is achieved. Anomalies:  Lost updates  The effects of some transactions are not reflected on the database.  Inconsistent retrievals  A transaction, if it reads the same data item more than once, should always read the same value.

Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Execution Schedule (or History) An order in which the operations of a set of transactions are executed. A schedule (history) can be defined as a partial order over the operations of a set of transactions. H 1 ={ W 2 ( x ), R 1 ( x ), R 3 ( x ), W 1 ( x ), C 1, W 2 ( y ), R 3 ( y ), R 2 ( z ), C 2, R 3 ( z ), C 3 } T 1 :Read( x ) T 2 :Write( x ) T 3 :Read( x ) Write( x )Write( y )Read( y ) CommitRead( z )Read( z ) CommitCommit

Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Formalization of Schedule A complete schedule SC ( T ) over a set of transactions T ={ T 1, …, T n } is a partial order SC ( T )={  T, < T } where  T =  i  i, for i = 1, 2, …, n < T   i < i, for i = 1, 2, …, n For any two conflicting operations O ij, O kl   T, either O ij < T O kl or O kl < T O ij

Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Given three transactions T 1 :Read( x ) T 2 :Write( x ) T 3 :Read( x ) Write( x )Write( y )Read( y ) CommitRead( z )Read( z )Commit A possible complete schedule is given as the DAG Complete Schedule – Example C 1 R3(x)R3(x)R1(x)R1(x)W2(x)W2(x) W1(x)W1(x)W2(y)W2(y)R3(y)R3(y) R3(z)R3(z)R2(z)R2(z) C 2 C 3

Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez A schedule is a prefix of a complete schedule such that only some of the operations and only some of the ordering relationships are included. T 1 :Read( x ) T 2 :Write( x ) T 3 :Read( x ) Write( x )Write( y )Read( y ) CommitRead( z )Read( z )Commit Schedule Definition R1(x)R1(x) C 1 R3(x)R3(x) R1(x)R1(x) R3(x)R3(x)W2(x)W2(x)W2(x)W2(x) W1(x)W1(x)W2(y)W2(y)W2(y)W2(y)R3(y)R3(y)R3(y)R3(y) R3(z)R3(z)R3(z)R3(z)R2(z)R2(z)R2(z)R2(z) C 2 C 3 

Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Serial History All the actions of a transaction occur consecutively. No interleaving of transaction operations. If each transaction is consistent (obeys integrity rules), then the database is guaranteed to be consistent at the end of executing a serial history. T 1 :Read( x ) T 2 :Write( x ) T 3 :Read( x ) Write( x )Write( y )Read( y ) CommitRead( z )Read( z ) CommitCommit H s ={ W 2 ( x ), W 2 ( y ), R 2 ( z ), C 2, R 1 ( x ), W 1 ( x ), C 1, R 3 ( x ), R 3 ( y ), R 3 ( z ), C 3 }

Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Serializable History Transactions execute concurrently, but the net effect of the resulting history upon the database is equivalent to some serial history. Equivalent with respect to what?  Conflict equivalence : the relative order of execution of the conflicting operations belonging to unaborted transactions in two histories are the same.  Conflicting operations : two incompatible operations (e.g., Read and Write) conflict if they both access the same data item.  Incompatible operations of each transaction is assumed to conflict; do not change their execution orders.  If two operations from two different transactions conflict, the corresponding transactions are also said to conflict.

Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Serializable History The following are not conflict equivalent H s ={ W 2 ( x ), W 2 ( y ), R 2 ( z ), C 2, R 1 ( x ), W 1 ( x ), C 1, R 3 ( x ), R 3 ( y ), R 3 ( z ), C 3 } H 1 ={ W 2 ( x ), R 1 ( x ), R 3 ( x ), W 1 ( x ), C 1, W 2 ( y ), R 3 ( y ), R 2 ( z ), C 2, R 3 ( z ), C 3 } The following are conflict equivalent; therefore H 2 is serializable. H s ={ W 2 ( x ), W 2 ( y ), R 2 ( z ), C 2, R 1 ( x ), W 1 ( x ), C 1, R 3 ( x ), R 3 ( y ), R 3 ( z ), C 3 } H 2 ={ W 2 ( x ), R 1 ( x ), W 1 ( x ), C 1, R 3 ( x ), W 2 ( y ), R 3 ( y ), R 2 ( z ), C 2, R 3 ( z ), C 3 } T 1 :Read( x ) T 2 :Write( x ) T 3:Read( x ) Write( x )Write( y )Read( y ) CommitRead( z )Read( z ) CommitCommit

Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Serializability in Distributed DBMS Somewhat more involved. Two histories have to be considered:  local histories  global history For global transactions (i.e., global history) to be serializable, two conditions are necessary:  Each local history should be serializable.  Two conflicting operations should be in the same relative order in all of the local histories where they appear together.

Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Global Non-serializability The following two local histories are individually serializable (in fact serial), but the two transactions are not globally serializable. T 1 :Read( x ) T 2 :Read( x ) x  x  5 x  x  15 Write( x )Write( x )Commit LH 1 ={ R 1 ( x ), W 1 ( x ), C 1, R 2 ( x ), W 2 ( x ), C 2 } LH 2 ={ R 2 (x), W 2 (x), C 2, R 1 (x), W 1 (x), C 1 }

Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Evaluation Criterion for Concurrency Control 1. Degree of Concurrency Less reshuffle  High degree of concurrency 2. Resources used to recognize - Lock tables - Time stamps - Read/write sets - Complexity 3. Costs - Programming ease Scheduler Recognizes or Reshuffles history (requested)(executed)

Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez General Comments Information needed by Concurrency Controllers  Locks on database objects  Time stamps on database objects  Time stamps on transactions Observations  Time stamps mechanisms more fundamental than locking  Time stamps carry more information  Checking locks costs less than checking time stamps

Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez General Comments (cont.) When to synchronize  First access to an object (Locking, pessimistic validation)  At each access (question of granularity)  After all accesses and before commitment (optimistic validation) Fundamental notions  Rollback  Identification of useless transactions  Delaying commit point  Semantics of transactions