Concurrency Control and Reliable Commit Protocol in Distributed Database Systems Jian Jia Chen 2002/05/09 Real-time and Embedded System Lab., CSIE, National.

Slides:



Advertisements
Similar presentations
Serializability in Multidatabases Ramon Lawrence Dept. of Computer Science
Advertisements

1 Concurrency Control Chapter Conflict Serializable Schedules  Two actions are in conflict if  they operate on the same DB item,  they belong.
Principles of Transaction Management. Outline Transaction concepts & protocols Performance impact of concurrency control Performance tuning.
Concurrency Control II
Concurrency Control II. General Overview Relational model - SQL  Formal & commercial query languages Functional Dependencies Normalization Physical Design.
CS 603 Handling Failure in Commit February 20, 2002.
Distributed Transaction Management, Fall 2002Lecture 2 / Distributed Deadlock Management Jyrki Nummenmaa
Concurrency Control.
Lecture 11 Recoverability. 2 Serializability identifies schedules that maintain database consistency, assuming no transaction fails. Could also examine.
Distributed databases
1 Chapter 3. Synchronization. STEMPusan National University STEM-PNU 2 Synchronization in Distributed Systems Synchronization in a single machine Same.
Database Systems, 8 th Edition Concurrency Control with Time Stamping Methods Assigns global unique time stamp to each transaction Produces explicit.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Transaction Management and Concurrency Control
CS 582 / CMPE 481 Distributed Systems Concurrency Control.
Transaction Management and Concurrency Control
Transaction Management and Concurrency Control
Distributed Systems1 Chapter 7: Distributed Transactions Transaction concepts Centralized/Distributed Transaction Architecture Schedule concepts Locking.
Transaction Management
1 Minggu 8, Pertemuan 15 Transaction Management Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
©Silberschatz, Korth and Sudarshan16.1Database System Concepts 3 rd Edition Chapter 16: Concurrency Control Lock-Based Protocols Timestamp-Based Protocols.
Concurrency Control John Ortiz.
9 Chapter 9 Transaction Management and Concurrency Control Hachim Haddouti.
CS4432transaction management1 CS4432: Database Systems II Lecture #23 Transaction Management Professor Elke A. Rundensteiner.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Distributed Systems Fall 2009 Distributed transactions.
Concurrency Control in Distributed Databases
© 1997 UW CSE 11/13/97N-1 Concurrency Control Chapter 18.1, 18.2, 18.5, 18.7.
Transactions and concurrency control
TRANSACTIONS AND CONCURRENCY CONTROL Sadhna Kumari.
AN OPTIMISTIC CONCURRENCY CONTROL ALGORITHM FOR MOBILE AD-HOC NETWORK DATABASES Brendan Walker.
Lecture 11 Distributed Transaction Management. Concurrency Control The problem of synchronizing concurrent transactions such that the consistency of the.
Distributed DBMSSlide 1Lectured by, Jesmin Akhter, Assistant Professor, IIT, JU PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor,
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 10 Transaction Management.
Transaction Communications Yi Sun. Outline Transaction ACID Property Distributed transaction Two phase commit protocol Nested transaction.
Chapterb19 Transaction Management Transaction: An action, or series of actions, carried out by a single user or application program, which reads or updates.
Distributed Transactions
Distributed Database Systems Overview
DISTRIBUTED COMPUTING
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Chapter 15 Concurrency Control Yonsei University 1 st Semester, 2015 Sanghyun Park.
Databases Illuminated
II.I Selected Database Issues: 2 - Transaction ManagementSlide 1/20 1 II. Selected Database Issues Part 2: Transaction Management Lecture 4 Lecturer: Chris.
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.
1 7. Distributed Concurrency Control Chapter 11 Distributed Concurrency Control.
Transaction Management Overview. Transactions Concurrent execution of user programs is essential for good DBMS performance. – Because disk accesses are.
Concurrency Control Introduction Lock-Based Protocols
IM NTU Distributed Information Systems 2004 Distributed Transactions -- 1 Distributed Transactions Yih-Kuen Tsay Dept. of Information Management National.
Introduction to Distributed Databases Yiwei Wu. Introduction A distributed database is a database in which portions of the database are stored on multiple.
1 CSE232A: Database System Principles More Concurrency Control and Transaction Processing.
Timestamp-based 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.
10 1 Chapter 10_B Concurrency Control Database Systems: Design, Implementation, and Management, Rob and Coronel.
SHUJAZ IBRAHIM CHAYLASY GNOPHANXAY FIT, KMUTNB JANUARY 05, 2010 Distributed Database Systems | Dr.Nawaporn Wisitpongphan | KMUTNB Based on article by :
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Last Class: Canonical Problems
Transaction Management and Concurrency Control
Outline Introduction Background Distributed DBMS Architecture
Chapter 10 Transaction Management and Concurrency Control
Outline Introduction Background Distributed DBMS Architecture
Concurrency Control and Reliable Commit Protocol in Distributed Database Systems Jian Jia Chen 2002/05/09 Real-time and Embedded System Lab., CSIE, National.
Outline Introduction Background Distributed DBMS Architecture
Distributed Database Management Systems
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Distributed Transactions
Chapter 7: Distributed Transactions
Concurrency Control Techniques
Transactions, Properties of Transactions
Presentation transcript:

Concurrency Control and Reliable Commit Protocol in Distributed Database Systems Jian Jia Chen 2002/05/09 Real-time and Embedded System Lab., CSIE, National Taiwan University.

Outline Distributed Database Management System (DDBMS) Concurrency Control models (CC) Deadlock Management in DDBMS Recovery and Reliable Mechanisms in DDBMS. Mobile Database

Distributed Database Management System (DDBMS) A collection of multiple, logically interrelated databases distributed over a computer network.A distributed database management system is as the software system that permits the management of the distributed database and make the distribution transparent to the users.

Architectural Models for Distributed Database Management System Autonomy(A): controller – 0: right integration, 1:semiautonomous system, 2: isolation Heterogeneity(H): – 0:homogenous, 1: heterogeneous Distribution(D): data arrangement – 0:no distribution, 1:client/server arch., 2:peer-to- peer

Issues in DDBMS Data Planning (NP-complete) Query Optimization and Decomposition (NP- complete) Distributed Transaction Management Fault Tolerance and Reliability Networking.

Transaction and Transaction Management The ACID property is still must be notified in DDBMS Transaction structures: flat, nested Begin_transaction T1(); T2(); …… End_transaction Begin_transaction Begin_transaction T1 Begin_transaction T2 T3(); …… End_transaction T2 End_transaction T1 End_transaction

Architecture Revised

Centralized Transaction Execution

Distributed Transaction Execution

Concurrency Control Algorithms Pessimistic – Two-phase locking protocol (Mutex) – Timestamp ordering protocol – Hybrid Optimistic – Locking based – Timestamp ordering based

Two-phase locking

Distributed 2PL

Centralized 2PL

Locking and Timestamp Ordering 2PL is simple and guarantees serializability but the locking may damage the throughput of the system, and may cause dead-lock. Timestamp Ordering (TO) protocols don ’ t attempt to maintain serializability of by mutual exclusion so that it won ’ t cause dead-lock TO rule: Given two conflicting operations O ij and O kl, belongs to T i and T k (T k is younger), the former operation is executed before the latter if and only if ts(T i ) < ts(T k )

Basic TO Algorithm Transaction (T i ) is assigned a globally unique timestamp ts(T i ) Transaction managers attach the timestamp to all operations issued by the transaction Each data item is assigned a write timestamp and a read timestamp: – rts(x), wts(x) For R t (x)for W t (x) – If ts(T t ) < wts(x) if ts(T t ) < rts(x) and ts(T t ) < wts(x) – then reject R t (x) then reject W t (x) – else accept R t (x) else accept W t (x) – rts(x) <- ts(T t ) wts(x) <- ts(T t )

Basic TO Algorithm (2) cont. The basic TO algorithm is simple and deadlock-free. The penalty of such mechanism is potential restart of a transaction numerous times. Take an example. The global unique timestamp assignment is not an easy problem neither.

Conservation TO Algorithms The previous example shows that the restart penalty may be serious, the conservation TO algo.s attempt to lower the aggressive restart. The algo.s delay each operation until there is an assurance that it will not be restarted

Deadlock Management There are some ways to solve the deadlock problem: prevention, avoidance, detection, and resolution. Deadlock prevention is not easy to achieve since it must have the complete serial graph A famous deadlock avoidance approach is similar with that in Operation Systems. Wait- Die and Wound-Die rule.

Wait-Die & Wound-Wait

Deadlock Detection Approach It is a NP-complete problem to find the minimum cost edge for breaking the deadlock cycle. Local wait-for graph and Global wait-for graph. We only concern the deadlocks among the sites. Topologies for deadlock detection algo. – Centralized – Distributed – Hierarchical

Distributed Reliability Protocols Commit protocols: – How to execute commit command for distributed transactions? How to ensure atomicity and durability. Termination protocols: – If a failure occurs, how do the remaining operational sites deal with it? Recovery protocols: – If a failure occurs, how do the site where the failure occurred deal with it? My focus is on the first issue

Two-Phase Commit Protocol I had reported this protocol briefly in my previous presentation. Global Commit Rule: all or nothing. Phase 1: The coordinator gets the participants ready to write the result to the physical storage. Phase 2: Everyone writes its results into the database. – Coordinator: – Participants:

Centralized 2PC

Linear 2PC

Distributed 2PC

State Transactions in 2PC

Site Failures and Recovery Develop non-blocking termination and independent recovery protocols. A proof shows that such protocols exist when a single site fails. However it is not possible to design independent recovery protocols when multiple sites fail.

Problems with 2PC Blocking – Ready implies that the participants wait for the coordinator – If coordinator fails, site is blocked until recovery. – Blocking reduces availability Independent recovery is not possible The 3PC protocol was proposed to solve the blocking problems. 3PC is non-blocking(non- realistic but reducing).

Three Phase Commit Protocol A proof shows that there are necessary and sufficient conditions for designing non-blocking atomic commitment protocols: – No state that is adjacent to both a commit and an abort state. (2PC violates) – No non-committable state that is adjacent to a commit state (Abort is not adjacent to Commit)

Three-Phase Commit Protocol

Mobile Databases Mobile database is an extension of distributed database system. A mobile database may contain databases connected with wire-line networks and databases built on mobile stations. The characteristics: – The wireless network have restricted bandwidth – The power supplies in Mobile stations have limited lifetimes – Because the power restrictions, mobile stations are not available always. – The mobile stations move in difference speeds, areas.

Mobile Databases cont.(2) Base on the previous characteristics, the CC problem in Mobile Databases is harder than that in distributed databases. The disconnection of stations is long, so that locking protocol and timestamp ordering protocol is not suitable. 2PC is not suitable neither, since the availability is reduced. Different transaction models were proposed in Mobile Database environment. ex. relaxation of the ACID property, relaxation of the serializability.

Mobile Databases cont.(3) It is much harder to design real-time mobile database systems. Because of the unpredictability of the environment, hard real-time transactions are hard to meet their deadline. Almost papers discuss about firm and soft real-time in the environment.

Conclusion

Happy Birthday to Me :^^ It ’ s my birthday ^)^