School of Information Technologies Hyungsoo Jung (presenter) Hyuck Han* Alan Fekete Uwe Röhm Serializable Snapshot Isolation for Replicated Databases in.

Slides:



Advertisements
Similar presentations
Concurrency Control III. General Overview Relational model - SQL Formal & commercial query languages Functional Dependencies Normalization Physical Design.
Advertisements

Optimistic Methods for Concurrency Control By : H.T. Kung & John T. Robinson Presenters: Munawer Saeed.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Transaction Management Overview Chapter 16.
Transaction Management: Concurrency Control CS634 Class 17, Apr 7, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
Principles of Transaction Management. Outline Transaction concepts & protocols Performance impact of concurrency control Performance tuning.
Concurrency Control II
Exploiting Distributed Version Concurrency in a Transactional Memory Cluster Kaloian Manassiev, Madalin Mihailescu and Cristiana Amza University of Toronto,
Presented by Dr. Greg Speegle.  Concurrency Control  Multiple Versions  Version number timestamp of writing transaction  Read last committed value.
Serializable Isolation for Snapshot Databases Michael J. Cahill, Uwe Röhm, and Alan D. Fekete University of Sydney ACM Transactions on Database Systems.
1 ICS 214B: Transaction Processing and Distributed Data Management Lecture 5: Tree-based Concurrency Control and Validation Currency Control Professor.
1 Database Replication Using Generalized Snapshot Isolation Sameh Elnikety, EPFL Fernando Pedone, USI Willy Zwaenepoel, EPFL.
Concurrency Control Nate Nystrom CS 632 February 6, 2001.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 16 – Intro. to Transactions.
ICS 421 Spring 2010 Transactions & Concurrency Control (i) Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Transaction Management and Concurrency Control
Transaction Management and Concurrency Control
1 Transaction Management Overview Yanlei Diao UMass Amherst March 15, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
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 Processing: Concurrency and Serializability 10/4/05.
Overview  Strong consistency  Traditional approach  Proposed approach  Implementation  Experiments 2.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
BACS 485—Database Management Concurrency Control Overview of Database Concurrency Control.
Transaction Management and Concurrency Control
Concurrency Control In Dynamic Database Systems Laurel Jones.
AN OPTIMISTIC CONCURRENCY CONTROL ALGORITHM FOR MOBILE AD-HOC NETWORK DATABASES Brendan Walker.
School of Information Technologies Michael Cahill 1, Uwe Röhm and Alan Fekete School of IT, University of Sydney {mjc, roehm, Serializable.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 10 Transaction Management.
TRANSACTIONS. Objectives Transaction Concept Transaction State Concurrent Executions Serializability Recoverability Implementation of Isolation Transaction.
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.
Consistent and Efficient Database Replication based on Group Communication Bettina Kemme School of Computer Science McGill University, Montreal.
1 Transaction Management Overview Chapter Transactions  Concurrent execution of user programs is essential for good DBMS performance.  Because.
1 Transactions Chapter Transactions A transaction is: a logical unit of work a sequence of steps to accomplish a single task Can have multiple.
Replicated Databases. Reading Textbook: Ch.13 Textbook: Ch.13 FarkasCSCE Spring
Transactions. What is it? Transaction - a logical unit of database processing Motivation - want consistent change of state in data Transactions developed.
Optimistic Methods for Concurrency Control By: H.T. Kung and John Robinson Presented by: Frederick Ramirez.
1 Multiversion Reconciliation for Mobile Databases Shirish Hemanath Phatak & B.R.Badrinath Presented By Presented By Md. Abdur Rahman Md. Abdur Rahman.
Transactions and Concurrency Control. Concurrent Accesses to an Object Multiple threads Atomic operations Thread communication Fairness.
2/29/ Replication CSEP 545 Transaction Processing Philip A. Bernstein Sameh Elnikety Copyright ©2012 Philip A. Bernstein.
Transaction Management Overview. Transactions Concurrent execution of user programs is essential for good DBMS performance. – Because disk accesses are.
9/27/05© 2005 Microsoft Corporation1 Relaxed-Currency Serializability Philip A. Bernstein, Microsoft Research Alan Fekete, Univ. of Sydney Raghu Ramakrishnan,
Introduction to Distributed Databases Yiwei Wu. Introduction A distributed database is a database in which portions of the database are stored on multiple.
3/6/99 1 Replication CSE Transaction Processing Philip A. Bernstein.
1 Advanced Database Concepts Transaction Management and Concurrency Control.
Multidatabase Transaction Management COP5711. Multidatabase Transaction Management Outline Review - Transaction Processing Multidatabase Transaction Management.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
SHUJAZ IBRAHIM CHAYLASY GNOPHANXAY FIT, KMUTNB JANUARY 05, 2010 Distributed Database Systems | Dr.Nawaporn Wisitpongphan | KMUTNB Based on article by :
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 16 – Intro. to Transactions.
Database Isolation Levels. Reading Database Isolation Levels, lecture notes by Dr. A. Fekete, resentation/AustralianComputer.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Don’t be lazy, be consistent: Postgres-R, A new way to implement Database Replication Paper by Bettina Kemme and Gustavo Alonso, VLDB 2000 Presentation.
Relaxed Currency Serializability for Middle-Tier Caching and Replication Philip A. Bernstein, Alan Fekete, Hongfei Guo, Raghu Ramakrishnan, Pradeep Tamma.
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
Transaction Management Overview
Transaction Management
Transaction Management Overview
Transaction Management
Concurrency Control II (OCC, MVCC)
Chapter 10 Transaction Management and Concurrency Control
Lecture 21: Concurrency & Locking
Distributed Transactions
Lecture 21: Intro to Transactions & Logging III
Transaction Management
Transaction Management Overview
Concurrency control (OCC and MVCC)
Transactions, Properties of Transactions
Presentation transcript:

School of Information Technologies Hyungsoo Jung (presenter) Hyuck Han* Alan Fekete Uwe Röhm Serializable Snapshot Isolation for Replicated Databases in High-Update Scenarios The University of Sydney *Seoul National University

Data Replication in the 21 st Century 2 Data Replication with Relaxed Consistency Data Replication with Relaxed Consistency Simple replication does not guarantee “ strong consistency ” You could use locking for strong consistency... You could use locking for strong consistency...

“The Dangers of Replication …” [Jim Gray et al., SIGMOD’96] 3 “Update anywhere- anytime-anyway transactional replication has unstable behaviors…” This is especially true to all the then- known locking-based replication. So use Snapshot Isolation (SI) in each replica, then build replicated snapshot DBs.

Snapshot Isolation [Berenson et al., SIGMOD’95] Snapshot Isolation (SI): –Transactions read a consistent snapshot of data DBMS maintains multiple versions of data items to avoid locking for reads –Only one transaction among many updating the same data concurrently can commit by the First-Committer-Wins (FCW) rule. –1-copy SI is for replicated databases 4

Problems in Replicated Snapshot DB 5 DB under SI Replica 1 Replica N Update Propagation Users Transactions may see different values  Replicated DB under Snapshot Isolation does not prevent data corruption and violation of integrity constraints (ICs).  1-copy serializability (1-copy SR) is the only condition that preserves the truth of all ICs. Update anywhere- anytime-anyway transactional replication

Anomaly under 1-copy SI 6 DoctorShiftStatus Jones31 AUGon duty Smith31 AUGon duty DoctorShiftStatus Jones31 AUGon duty Smith31 AUGon duty DoctorShiftStatus Jones31 AUGon duty Smith31 AUGon duty Replicated Replica A Replica B Example by courtesy of Cahill et al. [SIGMOD’08]

7 DoctorShiftStatus Jones31 AUGon duty Smith31 AUGon duty DoctorShiftStatus Jones31 AUGon duty Smith31 AUGon duty Replica A Replica B T 1 (Update Jones) T 2 (Update Smith) Anomaly under 1-copy SI Example by courtesy of Cahill et al. [SIGMOD’08] Integrity Constraint - One doctor must be “on duty” in every shift. Integrity Constraint - One doctor must be “on duty” in every shift.

8 DoctorShiftStatus Jones31 AUGon duty Smith31 AUGreserve DoctorShiftStatus Jones31 AUGreserve Smith31 AUGon duty Replica A Replica B Commit T 1 Commit T 2 Anomaly under 1-copy SI Example by courtesy of Cahill et al. [SIGMOD’08] Integrity Constraint - One doctor must be “on duty” in every shift. Integrity Constraint - One doctor must be “on duty” in every shift.

Integrity Constraint - One doctor must be “on duty” in every shift. Integrity Constraint - One doctor must be “on duty” in every shift. 9 DoctorShiftStatus Jones31 AUGreserve Smith31 AUGreserve DoctorShiftStatus Jones31 AUGreserve Smith31 AUGreserve Replica A Replica B Anomaly under 1-copy SI Example by courtesy of Cahill et al. [SIGMOD’08] Violation of IC

Why 1-Copy SI ≠ 1-Copy SR ? Under Snapshot Isolation: –Transactions don’t see concurrent writes This causes some interleaving anomalies, which makes (1-copy) SI not equivalent to (1-copy) serializable execution. 10 r 1 (Jones=“on duty”, Smith=“on duty”) w 1 (Jones=“reserve”) T1T1 r 2 (Jones=“on duty”, Smith=“on duty”) w 2 (Smith=“reserve”) T2T2 Write-Skew

The Goal of Concurrency Control 11

Our Contributions Update anywhere-anytime-anyway transactional replication 1-copy SR over SI replicas New theorem & Prototype implementation Optimized for update-heavy workloads 12

Our Approach New algorithm for 1-copy SR –Runtime analysis of the transaction serialization graph, considering consecutive rw -edges –New sufficient condition for 1-copy SR Core Ideas: –Detect read-write conflicts at runtime, i.e., commit time. –Abort transactions with a certain pattern of consecutive rw -edges –Retrieving complete rw -dependency information without propagating entire readsets. 13

Previous Work for 1-copy SR [Bornea et al., ICDE2011] 14 Bornea et al.This Work Architecture MiddlewareKernel Readset Extraction SQL parsingKernel interception Certification ww -conflict 1 rw -edge ww -conflict 2 rw -edges Optimized for Read mostlyUpdate heavy

Descending Structure 15 r1(x0) r2(y0)w2(x0) w3(y0) TpTp TfTf TtTt lsv (T p ) lsv (T f ) lsv (T t ) There are three transactions T p, T f and T t with the following relationships: 1.T p T f and T f T t 2.lsv (T f ) lsv (T p ) && lsv (T t ) lsv (T p ) Descending Structure lsv is a number we keep for each transaction: largest timestamp a transaction reads from

Main Theorem for 1-copy SR 16 Central Theorem: Let h be a history over a set of transactions obeying the following conditions –1-copy SI –No descending structure Then h is 1-copy serializable.

Concurrency Control Algorithm Replicated Serializable Snapshot Isolation (RSSI) –ww -conflicts are handled by 1-copy SI. –When certification detects a “ descending structure ”, we abort whichever completes last among the three transactions. 17 r1(x0) r2(y0)w2(x0) w3(y0) TpTp TfTf TtTt lsv( T p 1 ) lsv( T f ) lsv( T t ) Abort T f

Technical Challenges The management of readset information and lsv - timestamps is pivotal to certification. We developed a global dependency checking protocol (GDCP) on top of LCR broadcast protocol [Guerraoui et al., ACM TOCS2010]. –GDCP mainly performs two tasks at the same time: Total order generation using existing LCR protocol. Exchanging rw -dependency information without sending the entire readset. 18

In Each Participating Node 19 Storage readset & writeset extraction readset & writeset extraction Certifier Replication Manager Certifier Replication Manager Query Processing To other replicas Implementation is based on Postgres-RSI

Propagating rw -dependency Information 20 WS1 rw-edges1 Update writeset2 readset2 WS1 RS1 Check rw -edges

Discussion 21 RSSI has overhead in read mostly scenarios due to full certification on all types of transactions. RSSI still has some false positives: r1(x0) r2(y0)w2(x0) w3(y0) TpTp TfTf TtTt lsv (T p ) lsv (T f ) lsv (T t ) Abort Tt

Experimental Setup Comparing –RSSI (Postgres-RSSI) : our proposal (1SR) –CP-ROO – conflict-management of Bornea et al. with our architecture (1SR) –RSI : certification algorithm of Lin et al. with our architecture 1-SI, but not 1SR !! Synthetic micro-benchmark –Update transactions read from a table, update records in a different table. –Read-only transactions read from a table. TPC-C++ [Cahill et al.,TODS2009] –No evident difference in performance between the three algorithms (details in the paper) 22

Micro-benchmark, 75%Updates: Throughput (8 Replicas) 23

Micro-benchmark, 75%Updates: Throughput & Aborts (8 Replicas) 24

Micro-benchmark: Performance Spectrum (8 Replicas, MPL=640) 25

Summary Update anywhere-anytime-anyway transactional replication 1 SR over SI replicas New theorem & Prototype implementation Optimized for update heavy 26 Thank You Q&A