Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/1 Outline Introduction Background Distributed Database Design Database Integration Semantic Data Control.

Slides:



Advertisements
Similar presentations
Universität Karlsruhe (TH) © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Chapter 1 Transactions and transactional properties.
Advertisements

Transactional Workflow Chapter 9. © Jim Gray, Andreas Reuter Transaction Processing - Concepts and Techniques WICS August 2 - 6, What Is the Problem.
Data recovery 1. 2 Recovery - introduction recovery restoring a system, after an error or failure, to a state that was previously known as correct have.
Concurrency control 1. 2 Introduction concurrency more than one transaction have access to data simultaneously part of transaction processing.
1 Term 2, 2004, Lecture 6, TransactionsMarian Ursu, Department of Computing, Goldsmiths College Transactions 3.
Dr Alwyn Barry Dr Joanna Bryson
CM20145 Transactions & Serializability
Database Systems: Design, Implementation, and Management
Lecture plan Transaction processing Concurrency control
© 2012 National Heart Foundation of Australia. Slide 2.
Indra Budi Transaction Indra Budi
Outline Introduction Background Distributed Database Design
Outline Introduction Background Distributed Database Design
Chapter 14: Transactions
Distributed DBMS©M. T. Özsu & P. Valduriez Ch.14/1 Outline Introduction Background Distributed Database Design Database Integration Semantic Data Control.
Transactions - Concurrent access & System failures - Properties of Transactions - Isolation Levels 4/13/2015Databases21.
Transaction Models of DDBMS Zsolt Németh Topics covered: –Transactions –Characterization of transactions –Formalization of transactions –Serializability.
Introduction to Database Systems1 Concurrency Control CC.Lecture 1.
1 Integrity Ioan Despi Transactions: transaction concept, transaction state implementation of atomicity and durability concurrent executions serializability,
Principles of Transaction Management. Outline Transaction concepts & protocols Performance impact of concurrency control Performance tuning.
Transactions (Chapter ). What is it? Transaction - a logical unit of database processing Motivation - want consistent change of state in data Transactions.
Fakultas Ilmu Komputer UI 1 Exercise A series of actions to be taken on the database such that either all actions are completed successfully, or none of.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Transaction Management and Concurrency Control
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Chapter 15 Transaction Management. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Transaction basics Concurrency.
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
1 Concurrency Control and Recovery Module 6, Lecture 1.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Transaction Management
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.
Transaction Management and Concurrency Control
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
INTRODUCTION TO TRANSACTION PROCESSING CHAPTER 21 (6/E) CHAPTER 17 (5/E)
Transaction Processing Concepts
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.
Introduction to Transaction Management
DB Transactions CS143 Notes TRANSACTION: A sequence of SQL statements that are executed "together" as one unit:
Database Management Systems, 2 nd Edition. R. Ramakrishnan and J. Gehrke1 Transaction Management Overview Lecture 21 Ramakrishnan - Chapter 18.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Transaction Management Overview Chapter 16.
PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
1 Transaction Management Overview Chapter Transactions  Concurrent execution of user programs is essential for good DBMS performance.  Because.
TRANSACTION MANAGEMENT R.SARAVANAKUAMR. S.NAVEEN..
PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 136 Database Systems I SQL Modifications and Transactions.
Lecture 13 Advanced Transaction Models. 2 Protocols considered so far are suitable for types of transactions that arise in traditional business applications,
Chapter 15: Transactions Loc Hoang CS 157B. Definition n A transaction is a discrete unit of work that must be completely processed or not processed at.
Jennifer Widom Transactions Properties. Jennifer Widom Transactions Solution for both concurrency and failures A transaction is a sequence of one or more.
CM Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration.
1 Advanced Database Concepts Transaction Management and Concurrency Control.
Multidatabase Transaction Management COP5711. Multidatabase Transaction Management Outline Review - Transaction Processing Multidatabase Transaction Management.
10 1 Chapter 10 - A Transaction Management Database Systems: Design, Implementation, and Management, Rob and Coronel.
18 September 2008CIS 340 # 1 Last Covered (almost)(almost) Variety of middleware mechanisms Gain? Enable n-tier architectures while not necessarily using.
H.Lu/HKUST L06: Concurrency Control & Locking. L06: Concurrency Control & Locking - 2 H.Lu/HKUST Transactions  Concurrent execution of user programs.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
1 Concurrency Control. 2 Why Have Concurrent Processes? v Better transaction throughput, response time v Done via better utilization of resources: –While.
Transaction Management and Concurrency Control
Transactions Properties.
Ch 21: Transaction Processing
Chapter 10 Transaction Management and Concurrency Control
Outline Introduction Background Distributed DBMS Architecture
Database Security Transactions
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Distributed Database Management Systems
Distributed Database Management Systems
Outline Introduction Background Distributed DBMS Architecture
Presentation transcript:

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/1 Outline Introduction Background Distributed Database Design Database Integration Semantic Data Control Distributed Query Processing Multidatabase Query Processing Distributed Transaction Management Transaction Concepts and Models Distributed Concurrency Control Distributed Reliability Data Replication Parallel Database Systems Distributed Object DBMS Peer-to-Peer Data Management Web Data Management Current Issues

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/2 Transaction A transaction is a collection of actions that make consistent transformations of system states while preserving system consistency. concurrency transparency failure transparency Database in a consistent state Database may be temporarily in an inconsistent state during execution Begin Transaction End Transaction Execution of Transaction Database in a consistent state

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/3 Transaction Example – A Simple SQL Query Transaction BUDGET_UPDATE begin EXEC SQLUPDATEPROJ SET BUDGET = BUDGET 1.1 WHEREPNAME = CAD/CAM end.

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/4 Example Database Consider an airline reservation example with the relations: FLIGHT(FNO, DATE, SRC, DEST, STSOLD, CAP) CUST(CNAME, ADDR, BAL) FC(FNO, DATE, CNAME,SPECIAL)

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/5 Example Transaction – SQL Version Begin_transaction Reservation begin input (flight_no, date, customer_name); EXEC SQLUPDATEFLIGHT SETSTSOLD = STSOLD + 1 WHEREFNO = flight_no AND DATE = date; EXEC SQLINSERT INTOFC(FNO, DATE, CNAME, SPECIAL); VALUES(flight_no, date, customer_name, null ); output (reservation completed) end. {Reservation}

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/6 Termination of Transactions Begin_transaction Reservation begin input (flight_no, date, customer_name); EXEC SQLSELECT STSOLD,CAP INTOtemp1,temp2 FROMFLIGHT WHEREFNO = flight_no AND DATE = date; if temp1 = temp2 then output (no free seats); Abort else EXEC SQLUPDATEFLIGHT SETSTSOLD = STSOLD + 1 WHEREFNO = flight_no AND DATE = date; EXEC SQLINSERT INTOFC(FNO, DATE, CNAME, SPECIAL); VALUES(flight_no, date, customer_name, null ); Commit output (reservation completed) endif end. {Reservation}

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/7 Example Transaction – Reads & Writes Begin_transaction Reservation begin input (flight_no, date, customer_name); temp Read(flight_no(date).stsold); if temp = flight(date).cap then begin output (no free seats); Abort end else begin Write(flight(date).stsold, temp + 1); Write(flight(date).cname, customer_name); Write(flight(date).special, null ); Commit ; output (reservation completed) end end. {Reservation}

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/8 Characterization Read set (RS) The set of data items that are read by a transaction Write set (WS) The set of data items whose values are changed by this transaction Base set (BS) RS WS

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/9 Formalization Let O ij ( x ) be some operation O j of transaction T i operating on entity x, where O j {read,write} and O j is atomic OS i = j O ij N i {abort,commit} Transaction T i is a partial order T i = { i, i } where i = OS i { N i } For any two operations O ij, O ik OS i, if O ij = R ( x ) and O ik = W ( x ) for any data item x, then either O ij i O ik or O ik i O ij O ij OS i, O ij i N i

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/10 Example Consider a transaction T : Read( x ) Read( y ) x x + y Write( x ) Commit Then = { R ( x ), R ( y ), W ( x ), C } = {( R ( x ), W ( x )), ( R ( y ), W ( x )), ( W ( x ), C ), ( R ( x ), C ), ( R ( y ), C )}

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/11 Assume = {( R ( x ), W ( x )), ( R ( y ), W ( x )), ( W ( x ), C ), ( R ( x ), C ), ( R ( y ), C )} DAG Representation R(x)R(x) C R(y)R(y) W(x)W(x)

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/12 Principles of Transactions A TOMICITY all or nothing C ONSISTENCY no violation of integrity constraints I SOLATION concurrent changes invisible serializable D URABILITY committed updates persist

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/13 Atomicity Either all or none of the transaction's operations are performed. Atomicity requires that if a transaction is interrupted by a failure, its partial results must be undone. The activity of preserving the transaction's atomicity in presence of transaction aborts due to input errors, system overloads, or deadlocks is called transaction recovery. The activity of ensuring atomicity in the presence of system crashes is called crash recovery.

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/14 Consistency Internal consistency A transaction which executes alone against a consistent database leaves it in a consistent state. Transactions do not violate database integrity constraints. Transactions are correct programs

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/15 Consistency Degrees Degree 0 Transaction T does not overwrite dirty data of other transactions Dirty data refers to data values that have been updated by a transaction prior to its commitment Degree 1 T does not overwrite dirty data of other transactions T does not commit any writes before EOT

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/16 Consistency Degrees (contd) Degree 2 T does not overwrite dirty data of other transactions T does not commit any writes before EOT T does not read dirty data from other transactions Degree 3 T does not overwrite dirty data of other transactions T does not commit any writes before EOT T does not read dirty data from other transactions Other transactions do not dirty any data read by T before T completes.

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/17 Isolation Serializability If several transactions are executed concurrently, the results must be the same as if they were executed serially in some order. Incomplete results An incomplete transaction cannot reveal its results to other transactions before its commitment. Necessary to avoid cascading aborts.

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/18 Isolation Example Consider the following two transactions: T 1 :Read( x ) T 2 :Read( x ) x x +1 Write( x )Write( x )Commit T 1 :Read( x ) T 1 : x x +1 T 1 : Write( x ) T 2 :Read( x ) T 1 : Commit T 1 : Write( x ) T 2 :Read( x ) T 2 : x x +1 T 2 : x x +1 T 2 :Write( x ) T 2 :Write( x ) T 1 : Commit T 2 :Commit Possible execution sequences:

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/19 SQL-92 Isolation Levels Phenomena: Dirty read T 1 modifies x which is then read by T 2 before T 1 terminates; T 1 aborts T 2 has read value which never exists in the database. Non-repeatable (fuzzy) read T 1 reads x ; T 2 then modifies or deletes x and commits. T 1 tries to read x again but reads a different value or cant find it. Phantom T 1 searches the database according to a predicate while T 2 inserts new tuples that satisfy the predicate.

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/20 SQL-92 Isolation Levels (contd) Read Uncommitted For transactions operating at this level, all three phenomena are possible. Read Committed Fuzzy reads and phantoms are possible, but dirty reads are not. Repeatable Read Only phantoms possible. Anomaly Serializable None of the phenomena are possible.

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/21 Durability Once a transaction commits, the system must guarantee that the results of its operations will never be lost, in spite of subsequent failures. Database recovery

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/22 Characterization of Transactions Based on Application areas Non-distributed vs. distributed Compensating transactions Heterogeneous transactions Timing On-line (short-life) vs batch (long-life) Organization of read and write actions Two-step Restricted Action model Structure Flat (or simple) transactions Nested transactions Workflows

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/23 Transaction Structure Flat transaction Consists of a sequence of primitive operations embraced between a begin and end markers. Begin_transaction Reservation … end. Nested transaction The operations of a transaction may themselves be transactions. Begin_transaction Reservation … Begin_transaction Airline … end. {Airline} Begin_transaction Hotel … end. {Hotel} end. {Reservation}

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/24 Nested Transactions Have the same properties as their parents may themselves have other nested transactions. Introduces concurrency control and recovery concepts to within the transaction. Types Closed nesting Subtransactions begin after their parents and finish before them. Commitment of a subtransaction is conditional upon the commitment of the parent (commitment through the root). Open nesting Subtransactions can execute and commit independently. Compensation may be necessary.

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/25 Workflows A collection of tasks organized to accomplish some business process. Types Human-oriented workflows Involve humans in performing the tasks. System support for collaboration and coordination; but no system-wide consistency definition System-oriented workflows Computation-intensive & specialized tasks that can be executed by a computer System support for concurrency control and recovery, automatic task execution, notification, etc. Transactional workflows In between the previous two; may involve humans, require access to heterogeneous, autonomous and/or distributed systems, and support selective use of ACID properties

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/26 Workflow Example T1T1 T2T2 T3T3 T4T4 T5T5 Customer Database Customer Database Customer Database T 1 : Customer request obtained T 2 :Airline reservation performed T 3 :Hotel reservation performed T 4 : Auto reservation performed T 5 : Bill generated

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/27 Transactions Provide… Atomic and reliable execution in the presence of failures Correct execution in the presence of multiple user accesses Correct management of replicas (if they support it)

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/28 Transaction Processing Issues Transaction structure (usually called transaction model) Flat (simple), nested Internal database consistency Semantic data control (integrity enforcement) algorithms Reliability protocols Atomicity & Durability Local recovery protocols Global commit protocols

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/29 Transaction Processing Issues Concurrency control algorithms How to synchronize concurrent transaction executions (correctness criterion) Intra-transaction consistency, Isolation Replica control protocols How to control the mutual consistency of replicated data One copy equivalence and ROWA

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/30 Architecture Revisited Scheduling/ Descheduling Requests Transaction Manager (TM) Distributed Execution Monitor With other SCs With other TMs Begin_transaction, Read, Write, Commit, Abort To data processor Results Scheduler (SC)

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/31 Centralized Transaction Execution Begin_Transaction, Read, Write, Abort, EOT Results & User Notifications Scheduled Operations Results … Read, Write, Abort, EOT User Application User Application Transaction Manager (TM) Scheduler (SC) Recovery Manager (RM)

Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/32 Distributed Transaction Execution Begin_transaction, Read, Write, EOT, Abort User application Results & User notifications Read, Write, EOT, Abort TM SC RM SC RM TM Local Recovery Protocol Distributed Concurrency Control Protocol Replica Control Protocol Distributed Transaction Execution Model