SHUJAZ IBRAHIM CHAYLASY GNOPHANXAY FIT, KMUTNB JANUARY 05, 2010 Distributed Database Systems | Dr.Nawaporn Wisitpongphan | KMUTNB Based on article by :

Slides:



Advertisements
Similar presentations
Chapter 16: Recovery System
Advertisements

Transaction Management: Concurrency Control CS634 Class 17, Apr 7, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
TRANSACTION PROCESSING SYSTEM ROHIT KHOKHER. TRANSACTION RECOVERY TRANSACTION RECOVERY TRANSACTION STATES SERIALIZABILITY CONFLICT SERIALIZABILITY VIEW.
Chapter 15: Transactions Transaction Concept Transaction Concept Concurrent Executions Concurrent Executions Serializability Serializability Testing for.
(c) Oded Shmueli Transactions Lecture 1: Introduction (Chapter 1, BHG) Modeling DB Systems.
Distributed Databases John Ortiz. Lecture 24Distributed Databases2  Distributed Database (DDB) is a collection of interrelated databases interconnected.
Transaction.
Distributed Systems 2006 Styles of Client/Server Computing.
Transaction Management and Concurrency Control
Synchronization. Physical Clocks Solar Physical Clocks Cesium Clocks International Atomic Time Universal Coordinate Time (UTC) Clock Synchronization Algorithms.
(c) Oded Shmueli Distributed Concurrency Control, Lecture 4 (BHG, Chap. 4 + Comp. Surveys Article)
Distributed Database Management Systems
Transaction Management and Concurrency Control
Transaction Management and Concurrency Control
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
1 Transaction Management Database recovery Concurrency control.
Chapter 12 Distributed Database Management Systems
9 Chapter 9 Transaction Management and Concurrency Control Hachim Haddouti.
©Silberschatz, Korth and Sudarshan17.1Database System Concepts 3 rd Edition Chapter 17: Recovery System Failure Classification Storage Structure Recovery.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Transaction. A transaction is an event which occurs on the database. Generally a transaction reads a value from the database or writes a value to the.
Concurrency Control in Distributed Databases
Transaction Management Chapter 9. What is a Transaction? A logical unit of work on a database A logical unit of work on a database An entire program An.
INTRODUCTION TO TRANSACTION PROCESSING CHAPTER 21 (6/E) CHAPTER 17 (5/E)
Multi-user Database Processing Architectures Architectures Transactions Transactions Security Security Administration Administration.
Database Management System Module 5 DeSiaMorewww.desiamore.com/ifm1.
TRANSACTIONS. Objectives Transaction Concept Transaction State Concurrent Executions Serializability Recoverability Implementation of Isolation Transaction.
Session-8 Data Management for Decision Support
10 1 Chapter 10 Distributed Database Management Systems Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 12 Distributed Database Management Systems.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 12 Distributed Database Management Systems.
Week 5 Lecture Distributed Database Management Systems Samuel ConnSamuel Conn, Asst Professor Suggestions for using the Lecture Slides.
Transaction Processing Concepts. 1. Introduction To transaction Processing 1.1 Single User VS Multi User Systems One criteria to classify Database is.
ITEC 3220M Using and Designing Database Systems Instructor: Prof. Z. Yang Course Website: 3220m.htm
Distributed Database Systems Overview
Chapter 15 Recovery. Topics in this Chapter Transactions Transaction Recovery System Recovery Media Recovery Two-Phase Commit SQL Facilities.
1 Transactions Chapter Transactions A transaction is: a logical unit of work a sequence of steps to accomplish a single task Can have multiple.
Chapter 16 Recovery Yonsei University 1 st Semester, 2015 Sanghyun Park.
SYNCHRONIZATION TECHNIQUES BASED ON TWO-PHASE LOCKING
Concurrency Control. Objectives Management of Databases Concurrency Control Database Recovery Database Security Database Administration.
Databases Illuminated
XA Transactions.
Database Systems Recovery & Concurrency Lecture # 20 1 st April, 2011.
CM Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration.
Chapter 17: Recovery System
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 14: Transactions.
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.
 Distributed Database Concepts  Parallel Vs Distributed Technology  Advantages  Additional Functions  Distribution Database Design  Data Fragmentation.
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.
10 1 Chapter 10_B Concurrency Control Database Systems: Design, Implementation, and Management, Rob and Coronel.
3 Database Systems: Design, Implementation, and Management CHAPTER 9 Transaction Management and Concurrency Control.
Topics in Distributed Databases Database System Implementation CSE 507 Some slides adapted from Navathe et. Al and Silberchatz et. Al.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Concurrency Control in Distributed Database Systems Intelligent Information Systems Seminar 2 nd Sep 2015 Based on: Philip A. Bernstein and Nathan Goodman.
Distributed Databases – Advanced Concepts Chapter 25 in Textbook.
Database Recovery Techniques
Database Transaction Abstraction I
Transaction Management and Concurrency Control
Database System Implementation CSE 507
Temple University – CIS Dept. CIS661 – Principles of Data Management
Chapter 10 Transaction Management and Concurrency Control
Outline Introduction Background Distributed DBMS Architecture
Database Security Transactions
Recovery System.
Distributed Transactions
Distributed Databases Recovery
C. Faloutsos Transactions
Presentation transcript:

SHUJAZ IBRAHIM CHAYLASY GNOPHANXAY FIT, KMUTNB JANUARY 05, 2010 Distributed Database Systems | Dr.Nawaporn Wisitpongphan | KMUTNB Based on article by : PHILIP A. BERNSTEIN AND NATHAN GOODMAN

 Introduction : Concurrency  Transaction Processing Model Definitions DDBMS Architecture Centralized TP Model Two-Phase Commit Distributed TP Model  Concurrency Control Decomposition  Other Concurrency Control Method Certifiers  References Outline 2

Introduction 3  Concurrency Control Coordinating concurrent access to a DB in a multiuser DBMS Main problem: Preventing DB updates from one user interfering with DB retrieval or updates of another In DDBMS this problem is more complex due to ○ Users may access data stored in many computers ○ Concurrency control mechanism at one computer cannot instantaneously know about interactions at other computers

Introduction cont.  E.g. concurrency control anomalies 4 Connection A... SELECT row1... UPDATE row1... Connection B... SELECT row1... UPDATE row1 Lost update anomaly User ATimeUser B Read Employee Update Salary - Write Employee Read Employee Update Salary - Write Employee etc Sum = Read Employee Sum = Sum + Salary - Read Employee Sum = Sum + Salary etc Inconsistent retrieval anomaly

Definitions 5 DDBMS collection of sites interconnected by a network ○ Each site contain one or both software modules: a transaction manager (TM) or a data manager (DM) TM s supervise interactions between users and DDBMS DM s manage the actual DB Logical data items : X, Y, Z stored at any DM or redundantly on several DMs Logical DB state : assignment of values to logical data items Stored data item : stored copy of logical data item, for X stored copies denoted by x1,…xm Stored DB state : assignment of values to stored data Transactions: sequence of read and write operations on data items that logically functions as one unit of work ○ Each transaction must leave the DB in a consistent state if the DB is consistent when the transaction begins ○ Concurrency control algorithms make all of their decisions on the basis of the data items a transaction reads and writes Logical readset / writeset : logical data items a transaction reads / writes Stored readsets / writesets : stored data items a transcation reads / writes

DDBMS Architecture Transactions communicate with TMs In response to commands from transactions, TMs issue commands to DMs Each transaction supervised by single TM Transaction-TM interface four operations: READ(X), WRITE(X, new- value), BEGIN, END. DMs manage data TM-DM interaction in forms the core of the TP model 6 DDBMS architecture

Centralized TP Model 7 One TM and one DM executing at one site A transaction T has operations ○ BEGIN () {TM initializes a private workspace for T} ○ READ(X) { TM check X exist in T’s workspace Return value to T Else { TM issues dm-read(x) DM retrieve a copy of X from DB Return the value to T Put value in T’s workspace } ○ WRITE(X, new-value) { TM check X exist in T’s workspace update X = new-value Else { create X Assign X = new-value } ○ END () { For each X updated by T { TM issues dm-write(x) DM updates X in the stored db to value of X in T’s workspace } T’s finished executing Discard workspace }

Centralized TP Model cont. 8 DBMS may restart T any time before a dm-write has been processed Each dm-write permanently updates values in the DB, and we cannot restart T during this time, since it would reflect partial effects of the transaction DBMS avoid such partial results by having the property atomic commitment ○ Either all of a transaction’s dm-writes are processed or none are ○ Standard implementation of atomic commitment is a procedure called two-phase commit

Two-Phase Commit 9 Transaction T is updating data items X and Y When T issues its END two-phase commit begins ○ First Phase DM issues prewrite commands for X and Y Prewrite commands instruct DM to copy values of X and Y to secure storage If DBMS fails during this phase, no harm done. Since updates have not been copied to the stored DB ○ Second Phase TM issues dm-write commands for X and Y This command copies values of X and Y into the store DB If DBMS fails during this phase, the DB may contain incorrect information But system can recover later by using the values stored on secure storage Recovery reads values of X and Y from secure storage and resumes the commitment activity

Distributed TP Model TMs and DMs may run at different sites and movement of data between a TM and a DM can be expensive DDBMS can use query optimization procedures to reduce the cost Problem of atomic commitment is aggravated in a DDBMS ○ T is updating x, y, z stored at DM x, DM y, DM z ○ Suppose T’s TM fails after issuing dm-write( x ), before issuing dm-write for y and z ○ At this point DB is incorrect ○ In centralized DBMS this not harmful since no transaction can access DB until the TM recovers ○ In DDBMS, other TMs remain operational and can access the incorrect DB ○ To avoid this problem, in addition to specifying data items to be copied onto secure storage, prewrite is modified to specify which other DMs are involved in the commitment activity 10

Distributed TP Model cont. 11 A transaction T has operations ○ BEGIN () {TM initializes a private workspace for T} ○ READ(X) { TM check X exist in T’s workspace Return value to T Else { TM issues dm-read(x i ) to the DM where x i is stored DM retrieve a copy of x i from DB Return the value to T Put value in T’s workspace } ○ WRITE(X, new-value) { TM check X exist in T’s workspace update X = new-value Else { create X Assign X = new-value } ○ END () { ######Two-phase commit begins ###### For each X updated by T and for each stored copy x i of X { TM issues prewrite(x i ) DM copies value of X onto secure storage internal to the DM } For each logical data item updated by T { dm-write(x i ) DM copies value x i of from secure storage into the stored DB } T’s execution is finished }

Concurrency control Decomposition Serializability 2. A paradigm for concurrency Control

Serializability  Let E denote an execution of transactions T T n,. E is a serial execution if no transactions execute concurrently in E.

Serializability cont.

A Paradigm for Concurrency Control  Theorem 1: rw and ww Synchronization technique  Theorem 2: Bern.

Other Concurrency control Method 16 Certification Approach ○ dm-reads and prewrites are processes by FCFS with no synchronization ○ DMs maintain summary information about rw and ww conflicts, which they update every time an operation is processed ○ dm-reads and prewrites are never blocked or rejected even when there is a conflict ○ When T issues its END, DBMS decides whether or not to certify, and thereby commit, T ○ Synchronization is accomplished entirely by restarts, never by blocking ○ Decision to restart or not is made after the transaction has finished executing ○ Assumes that most executions are serializable ○ Includes summarization algorithm for storing information about dm-reads and prewrites ○ Certification algorithm for using summary information to certify transactions when they terminate ○ Main problem in summarization algorithm is avoiding the need to store information about already-certified transactions ○ Main problem in certification algorithm is obtaining a consistent copy of the summary information

Other Concurrency control Method cont. 17 Certification Using the → Relation ○ Construct the → relation as dm-reads and prewrites are processed (T j → T k ) ○ Pieces of → are distributed among the sites ○ To certify a transaction the system checks that → is acyclic, hence guarantees serializability ○ All sites must be checked to certify any transaction. Even sites at which the transaction never accessed data must participate in the cycle checking of →. ○ Since this problem is not solved yet, the certification approach is impractical in a distributed environment