04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Distributed Database Systems.

Slides:



Advertisements
Similar presentations
Types of Distributed Database Systems
Advertisements

V. Megalooikonomou Distributed Databases (based on notes by Silberchatz,Korth, and Sudarshan and notes by C. Faloutsos at CMU) Temple University – CIS.
Enterprise Systems Distributed databases and systems - DT
Distributed Databases John Ortiz. Lecture 24Distributed Databases2  Distributed Database (DDB) is a collection of interrelated databases interconnected.
Distributed databases
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Chapter 13 (Web): Distributed Databases
Advanced Database Systems September 2013 Dr. Fatemeh Ahmadi-Abkenari 1.
CS 582 / CMPE 481 Distributed Systems
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Overview Distributed vs. decentralized Why distributed databases
Lecture-12 Concurrency Control in Distributed Databases
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.
©Silberschatz, Korth and Sudarshan19.1Database System Concepts Lecture-10 Distributed Database System A distributed database system consists of loosely.
©Silberschatz, Korth and Sudarshan18.1Database System Concepts Centralized Systems Run on a single computer system and do not interact with other computer.
CS 603 Data Replication February 25, Data Replication: Why? Fault Tolerance –Hot backup –Catastrophic failure Performance –Parallelism –Decreased.
Distributed databases
Distributed Databases
Distributed Databases and DBMSs: Concepts and Design
04/20/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Distributed Database Systems.
1 Distributed and Parallel Databases. 2 Distributed Databases Distributed Systems goal: –to offer local DB autonomy at geographically distributed locations.
Database Design – Lecture 16
DISTRIBUTED DATABASE SYSTEM.  A distributed database system consists of loosely coupled sites that share no physical component  Database systems that.
1 Distributed Data Management Distributed Systems Department of Computer Science UC Irvine.
Distributed Databases By Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany) DIRECTOR ARUNAI ENGINEERING COLLEGE TIRUVANNAMALAI.
©Silberschatz, Korth and Sudarshan19.1Database System Concepts 1 Chapter 19: Distributed Databases Heterogeneous and Homogeneous Databases Distributed.
Lecture 16- Distributed Databases Advanced Databases Masood Niazi Torshiz Islamic Azad University- Mashhad Branch
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.
Distributed Databases Reference Books: An introduction to Database Systems - By C.J. Database Systems and Concepts – Silberchatz, Korth and Sudarshan Lecture.
Distributed Database Systems Overview
Operating Systems Distributed Coordination. Topics –Event Ordering –Mutual Exclusion –Atomicity –Concurrency Control Topics –Event Ordering –Mutual Exclusion.
A/18-849B/95-811A/19-729A Internet-Scale Sensor Systems: Design and Policy Lecture 7 Part 1. Distributed Databases Part 2. IrisNet Query Processing.
ASMA AHMAD 28 TH APRIL, 2011 Database Systems Distributed Databases I.
Databases Illuminated
PMIT-6101 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
Distributed Databases
Topic Distributed DBMS Database Management Systems Fall 2012 Presented by: Osama Ben Omran.
MBA 664 Database Management Systems Dave Salisbury ( )
Chapter 19 Distributed Databases. 2 Distributed Database System n A distributed DBS consists of loosely coupled sites that share no physical component.
Distributed Database: Part 2. Distributed DBMS Distributed database requires distributed DBMS Distributed database requires distributed DBMS Functions.
R*: An overview of the Architecture By R. Williams et al. Presented by D. Kontos Instructor : Dr. Megalooikonomou.
19.1Database System Concepts - 6 th Edition Chapter 19: Distributed Databases Heterogeneous and Homogeneous Databases Distributed Data Storage Distributed.
Introduction to Distributed Databases Yiwei Wu. Introduction A distributed database is a database in which portions of the database are stored on multiple.
 Distributed Database Concepts  Parallel Vs Distributed Technology  Advantages  Additional Functions  Distribution Database Design  Data Fragmentation.
Distributed DBMS, Query Processing and Optimization
Multidatabase Transaction Management COP5711. Multidatabase Transaction Management Outline Review - Transaction Processing Multidatabase Transaction Management.
Antidio Viguria Ann Krueger A Nonblocking Quorum Consensus Protocol for Replicated Data Divyakant Agrawal and Arthur J. Bernstein Paper Presentation: Dependable.
©Silberschatz, Korth and Sudarshan18.1Database System Concepts 3 rd Edition 1 Chapter 18: Distributed Databases Distributed Data Storage Network Transparency.
1 Information Retrieval and Use De-normalisation and Distributed database systems Geoff Leese September 2008, revised October 2009.
Topics in Distributed Databases Database System Implementation CSE 507 Some slides adapted from Navathe et. Al and Silberchatz et. Al.
CMS Advanced Database and Client-Server Applications Distributed Databases slides by Martin Beer and Paul Crowther Connolly and Begg Chapter 22.
1 Chapter 22 Distributed DBMSs - Concepts and Design Simplified Transparencies © Pearson Education Limited 1995, 2005.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 22: Distributed.
Distributed Databases “Fundamentals”
Distributed Databases – Advanced Concepts Chapter 25 in Textbook.
Distributed Database Concepts
Distributed Databases
Lecture 17- Distributed Databases (continued)
Chapter 19: Distributed Databases
Parallel and Distributed Databases
Database System Implementation CSE 507
Chapter 19: Distributed Databases
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 19: Distributed.
Commit Protocols CS60002: Distributed Systems
Outline Announcements Fault Tolerance.
Distributed Database Systems
Distributed Databases
Introduction of Week 14 Return assignment 12-1
Presentation transcript:

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Distributed Database Systems

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems data DBMS data DBMS data DBMS data DBMS Distributed Database System

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems In a homogeneous distributed database  All sites have identical software  Are aware of each other and agree to cooperate in processing user requests.  Each site surrenders part of its autonomy in terms of right to change schemas or software  Appears to user as a single system In a heterogeneous distributed database  Different sites may use different schemas and software Difference in schema is a major problem for query processing Difference in software is a major problem for transaction processing  Sites may not be aware of each other and may provide only limited facilities for cooperation in transaction processing

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Assume relational data model Replication  System maintains multiple copies of data, stored in different sites, for faster retrieval and fault tolerance. Fragmentation  Relation is partitioned into several fragments stored in distinct sites Replication and fragmentation can be combined  Relation is partitioned into several fragments: system maintains several identical replicas of each such fragment.

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Data Fragmentation Horizontal fragmentation: each tuple of r is assigned to one or more fragments Vertical fragmentation: the schema for relation r is split into several smaller schemas  All schemas must contain a common candidate key (or superkey) to ensure lossless join property.  A special attribute, the tuple-id attribute may be added to each schema to serve as a candidate key. Example : relation account with following schema Account-schema = (branch-name, account-number, balance)

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Horizontal Fragmentation of account Relation branch-nameaccount-numberbalance Hillside A-305 A-226 A account 1 =  branch-name=“Hillside” (account) branch-nameaccount-numberbalance Valleyview A-177 A-402 A-408 A account 2 =  branch-name=“Valleyview” (account)

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Vertical Fragmentation of employee-info Relation branch-name customer-name tuple-id Hillside Valleyview Hillside Valleyview Lowman Camp Kahn Green deposit 1 =  branch-name, customer-name, tuple-id (employee-info) account number balance tuple-id A-305 A-226 A-177 A-402 A-155 A-408 A-639 deposit 2 =  account-number, balance, tuple-id (employee-info)

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Data Transparency Data transparency: Degree to which system user may remain unaware of the details of how and where the data items are stored in a distributed system

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Naming of Data Items - Criteria 1. Every data item must have a system-wide unique name. 2. It should be possible to find the location of data items efficiently. 3. It should be possible to change the location of data items transparently. 4. Each site should be able to create new data items autonomously.

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Centralized Scheme - Name Server Structure:  name server assigns all names  each site maintains a record of local data items  sites ask name server to locate non-local data items Advantages:  satisfies naming criteria 1-3 Disadvantages:  does not satisfy naming criterion 4  name server is a potential performance bottleneck  name server is a single point of failure

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Use of Aliases Alternative to centralized scheme: each site prefixes its own site identifier to any name that it generates i.e., site 17.account.  Fulfills having a unique identifier, and avoids problems associated with central control.  However, fails to achieve network transparency. Solution: Create a set of aliases for data items; Store the mapping of aliases to the real names at each site. The user can be unaware of the physical location of a data item, and is unaffected if the data item is moved from one site to another.

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Distributed Transactions Transaction may access data at several sites. Each site has a local transaction manager responsible for:  Maintaining a log for recovery purposes  Participating in coordinating the concurrent execution of the transactions executing at that site. Each site has a transaction coordinator, which is responsible for:  Starting the execution of transactions that originate at the site.  Distributing subtransactions at appropriate sites for execution.  Coordinating the termination of each transaction that originates at the site, which may result in the transaction being committed at all sites or aborted at all sites.

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Two Phase Commit … … … … … prepare T ready T commit T abort?

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Handling Failures Participating site goes wrong Coordinator goes wrong Message lost Network partition

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Participating Site Goes Wrong … … … … … prepare T ready T abort T failure

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Participating Site Goes Wrong … … … … … prepare T ready T commit T failure ready T

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Coordinator Fails … … … … … prepare T ready T commit T failure ??? T? abort?

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Coordinator Fails If no commit has been sent out, participating sites will keep asking while holding resources

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Message Lost … … … … … prepare T ready T commit T

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Network Partition Coordinator and participation sites in the same partition Coordinator and participation sites in different partitions

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Persistent Messages Notion of a single transaction spanning multiple sites is inappropriate for many applications  E.g. transaction crossing an organizational boundary  No organization would like to permit an externally initiated transaction to block local transactions for an indeterminate period Persistent messaging systems are systems that provide transactional properties to messages Messages are guaranteed to be delivered exactly once Will discuss implementation techniques later

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Fund Transfer (2PC) A: B: 100 ??? Blocking problem!

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Fund Transfer (Persistent Message) A: B: 100 Persistent Message H Once transaction sending a message is committed, message must guaranteed to be delivered H Guarantee as long as destination site is up and reachable, code to handle undeliverable messages must also be available e.g. credit money back to source account.

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Implementation of Persistent Messaging Sending site protocol 1. Sending transaction writes message to a special relation messages-to- send. The message is also given a unique identifier. H Writing to this relation is treated as any other update, and is undone if the transaction aborts. H The message remains locked until the sending transaction commits 2. A message delivery process monitors the messages-to-send relation H When a new message is found, the message is sent to its destination H When an acknowledgment is received from a destination, the message is deleted from messages-to-send H If no acknowledgment is received after a timeout period, the message is resent H This is repeated until the message gets deleted on receipt of acknowledgement, or the system decides the message is undeliverable after trying for a very long time

04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Implementation of Persistent Messaging Receiving site protocol  When a message is received 1. it is written to a received-messages relation if it is not already present (the message id is used for this check). The transaction performing the write is committed 2. An acknowledgement (with message id) is then sent to the sending site. 4 There may be very long delays in message delivery coupled with repeated messages