Distributed Transactions

Slides:



Advertisements
Similar presentations
Types of Distributed Database Systems
Advertisements

Distributed Databases John Ortiz. Lecture 24Distributed Databases2  Distributed Database (DDB) is a collection of interrelated databases interconnected.
1 CSIS 7102 Spring 2004 Lecture 8: Recovery (overview) Dr. King-Ip Lin.
CMPT 401 Summer 2007 Dr. Alexandra Fedorova Lecture X: Transactions.
Transaction.
Database Systems, 8 th Edition Concurrency Control with Time Stamping Methods Assigns global unique time stamp to each transaction Produces explicit.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Chapter 13 (Web): Distributed Databases
Jan. 2014Dr. Yangjun Chen ACS Database recovery techniques (Ch. 21, 3 rd ed. – Ch. 19, 4 th and 5 th ed. – Ch. 23, 6 th ed.)
CMPT Dr. Alexandra Fedorova Lecture X: Transactions.
Database Replication techniques: a Three Parameter Classification Authors : Database Replication techniques: a Three Parameter Classification Authors :
Transaction Management and Concurrency Control
1 ICS 214B: Transaction Processing and Distributed Data Management Replication Techniques.
Overview Distributed vs. decentralized Why distributed databases
Manajemen Basis Data Pertemuan 10 Matakuliah: M0264/Manajemen Basis Data Tahun: 2008.
Chapter 8 : Transaction Management. u Function and importance of transactions. u Properties of transactions. u Concurrency Control – Meaning of serializability.
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
©Silberschatz, Korth and Sudarshan19.1Database System Concepts Distributed Transactions Transaction may access data at several sites. Each site has a local.
Database Administration Part 1 Chapter Six CSCI260 Database Applications.
Database System Concepts ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Remote Backup Systems.
Distributed Commit. Example Consider a chain of stores and suppose a manager – wants to query all the stores, – find the inventory of toothbrushes at.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
CS 603 Data Replication February 25, Data Replication: Why? Fault Tolerance –Hot backup –Catastrophic failure Performance –Parallelism –Decreased.
TRANSACTION PROCESSING TECHNIQUES BY SON NGUYEN VIJAY RAO.
Managing Multi-User Databases AIMS 3710 R. Nakatsu.
DBSQL 7-1 Copyright © Genetic Computer School 2009 Chapter 7 Transaction Management, Database Security and Recovery.
04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Distributed Database Systems.
DISTRIBUTED DATABASE SYSTEM.  A distributed database system consists of loosely coupled sites that share no physical component  Database systems that.
Database Management System Module 5 DeSiaMorewww.desiamore.com/ifm1.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 10 Transaction Management.
Reliability and Security in Database Servers By Samuel Njoroge.
Unit 9 Transaction Processing. Key Concepts Distributed databases and DDBMS Distributed database advantages. Distributed database disadvantages Using.
Lecture 12 Recoverability and failure. 2 Optimistic Techniques Based on assumption that conflict is rare and more efficient to let transactions proceed.
Recovery System By Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany) DIRECTOR ARUNAI ENGINEERING COLLEGE TIRUVANNAMALAI.
1 IRU Concurrency, Reliability and Integrity issues Geoff Leese October 2007 updated August 2008, October 2009.
Operating Systems Distributed Coordination. Topics –Event Ordering –Mutual Exclusion –Atomicity –Concurrency Control Topics –Event Ordering –Mutual Exclusion.
Chapter 16 Recovery Yonsei University 1 st Semester, 2015 Sanghyun Park.
Databases Illuminated
INFO1408 Database Design Concepts Week 16: Introduction to Database Management Systems Continued.
1 Principles of Database Systems With Internet and Java Applications Today’s Topic Chapter 15: Reliability and Security in Database Servers Instructor’s.
Distributed Database: Part 2. Distributed DBMS Distributed database requires distributed DBMS Distributed database requires distributed DBMS Functions.
Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE RECOVERY” (PART – 2) Academic Year 2014 Spring.
Transaction Management Transparencies. ©Pearson Education 2009 Chapter 14 - Objectives Function and importance of transactions. Properties of transactions.
Introduction to Distributed Databases Yiwei Wu. Introduction A distributed database is a database in which portions of the database are stored on multiple.
Distributed DBMS, Query Processing and Optimization
9 1 Chapter 9_B Concurrency Control Database Systems: Design, Implementation, and Management, Rob and Coronel.
10 1 Chapter 10_B Concurrency Control 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.
Topics in Distributed Databases Database System Implementation CSE 507 Some slides adapted from Navathe et. Al and Silberchatz et. Al.
Distributed Databases – Advanced Concepts Chapter 25 in Textbook.
CHAPTER 25 - Distributed Databases and Client–Server Architectures
Database recovery techniques
Remote Backup Systems.
Database Recovery Techniques
Managing Multi-User Databases
Transaction Properties
Concurrency Control via Timestamps
Commit Protocols CS60002: Distributed Systems
Outline Announcements Fault Tolerance.
Distributed Commit Phases
Chapter 10 Transaction Management and Concurrency Control
A View over Distributed databases
Module 17: Recovery System
Recovery System.
Distributed Databases Recovery
Database System Architectures
DBMS Module III DBMS
CONCURRENCY Concurrency is the tendency for different tasks to happen at the same time in a system ( mostly interacting with each other ) .   Parallel.
Remote Backup Systems.
Transactions, Properties of Transactions
Presentation transcript:

Distributed Transactions

Transaction Manager One at every site Maintains a log for recovery purposes (undo or redo) Participates in concurrency control scheme (more on this later) to coordinate transactions acting on its site http://www.thelostogle.com/2015/03/04/the-10-worst-people-in-your-office/

Transaction Monitor (Coordinator) Only one coordinator per transaction Starts the execution of a transaction Breaks transactions involving multiple sites into sub-transactions and distributes those sub- transactions to the transaction managers. Coordinates the termination of the transaction. https://acidpopcult.wordpress.com/2014/03/03/office-space-no-respect-for-laughter-snubsbyapc/office-space-2/

Distinguished Copy In systems with replication, designate a particular copy of each data item as distinguished. If you have complete replication, you can designate a site as the distinguished copy, called the primary site. All locking actions take place on the distinguished copy. Because there is only one distinguished copy, deadlocks and commits only need be resolved at that site. Then the changes can be propagated across the network. Once writes have occurred at all the sites, the commit can finish at the distinguished copy.

What are downsides of having a distinguished copy? 1. Single point of failure at distinguished copy 2. Write network bottleneck at distinguished copy 3. Impossible for non-redundant data distribution 4. Necessity of a top hat and monocle

Primary Site with Backup Site To reduce the problems associated with having a primary site as a distinguished copy, often a designated backup site is created. All locking actions are performed on both the primary and backup sites. If the primary site fails (in the middle of carrying out transactions), the backup site can immediately become the new primary site until the original primary site is restored. Upside: Greater reliability Downside: Slower transactions

Why does keeping a backup site slow transactions? 1. Changes made to the primary site must also be made to the backup site for each commit 2. Backup sites are slower because they need to keep backups/archives 3. Backup sites require network delays to ensure rollbacks always happen 4. Because you said it did on the previous slide

Primary Copy A variant of the Primary Site idea is to have there be a Primary Copy of each database item (that aren't necessarily co-located). With a Primary Copy, certain elements (tables, rows, etc) have a distinguished copy, but the distinguished copy of a different element may be at a different site. If you don't have complete replication, you can't have a Primary Site, but you can have a Primary Copy for each part of your database.

What do you do if the Primary Site/Copy fails? 1. Make the Backup Site/Copy the primary 2. Scapegoat the chief technical officer 3. Fire your database administrator 4. Cry

Choosing a new Primary Site If your Primary Copy fails, you make the Backup Copy the new primary. Which site becomes the new Primary Site? The most common approach is to have the sites have an election, with the winner becoming the new Primary Site. Election details vary with each implementation, but the point is to ensure only one site is designated as the Primary Site.

Voting instead of Distinguished Copy An alternative to distinguished copy (one site being responsible for some/all of the locking actions of the entire distributed database) is voting. For each lock request, every site votes on if that lock should be granted. If a majority agree, the lock is granted everywhere. Although this is nice and decentralized, the implementation is very complex, and the amount of network traffic to make is happen is sometimes exorbitant. http://www.quickmeme.com/meme/3rlhow