1 Chapter 13: Distributed Databases. Chapter 13 2 Definitions Distributed Database: A single logical database that is spread physically across computers.

Slides:



Advertisements
Similar presentations
Database Systems: Design, Implementation, and Management
Advertisements

Distributed Databases John Ortiz. Lecture 24Distributed Databases2  Distributed Database (DDB) is a collection of interrelated databases interconnected.
Distributed databases
Transaction.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Chapter 13 (Web): Distributed Databases
Chapter 12 (Online): Distributed Databases
Distributed Databases Logical next step in geographically dispersed organisations goal is to provide location transparency starting point = a set of decentralised.
ABCSG - Distributed Database 1 Data Management Distributed Database Data Replication.
Distributed Database Management Systems
Chapter 9 : Distributed Database.
Overview Distributed vs. decentralized Why distributed databases
1 © Prentice Hall, 2002 Chapter 13: Distributed Databases Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden.
Distributed Database Management Systems
©Silberschatz, Korth and Sudarshan19.1Database System Concepts Lecture-10 Distributed Database System A distributed database system consists of loosely.
Chapter 12 Distributed Database Management Systems
Chapter 13 (Web): Distributed Databases
Definition of terms Definition of terms Explain business conditions driving distributed databases Explain business conditions driving distributed databases.
Distributed databases
Distributed Databases
Distributed Database and Replication. Distributed Database A logically interrelated collection of shared data and a description of this data physically.
DISTRIBUTED DATABASES AND DDBMS.  Understand the concept of “Distributed Data”  Describe various Distributed Data and DDBMS implementations  Explain.
1 Distributed and Parallel Databases. 2 Distributed Databases Distributed Systems goal: –to offer local DB autonomy at geographically distributed locations.
IMS 4212: Distributed Databases 1 Dr. Lawrence West, Management Dept., University of Central Florida Distributed Databases Business needs.
12 1 Chapter 12 Distributed Database Management Systems Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database Design – Lecture 16
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
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.
Lecture 11 Distributed Databases and Cloud computing
Massively Distributed Database Systems - Distributed DBS Spring 2014 Ki-Joune Li Pusan National University.
Lecture 5: Sun: 1/5/ Distributed Algorithms - Distributed Databases Lecturer/ Kawther Abas CS- 492 : Distributed system &
10 1 Chapter 10 Distributed Database Management Systems Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
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.
Week 5 Lecture Distributed Database Management Systems Samuel ConnSamuel Conn, Asst Professor Suggestions for using the Lecture Slides.
Distributed Database Systems Overview
G063 - Distributed Databases. Learning Objectives: By the end of this topic you should be able to: explain how databases may be stored in more than one.
Oracle's Distributed Database Bora Yasa. Definition A Distributed Database is a set of databases stored on multiple computers at different locations and.
Distributed Databases
ASMA AHMAD 28 TH APRIL, 2011 Database Systems Distributed Databases I.
1 Distributed Databases BUAD/American University Distributed Databases.
Databases Illuminated
CS338Parallel and Distributed Databases11-1 Parallel and Distributed Databases Lecture Topics Multi-CPU and distributed systems Monolithic system Client–server.
Distributed Databases
Topic Distributed DBMS Database Management Systems Fall 2012 Presented by: Osama Ben Omran.
MBA 664 Database Management Systems Dave Salisbury ( )
Distributed Database: Part 2. Distributed DBMS Distributed database requires distributed DBMS Distributed database requires distributed DBMS Functions.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 12 (Online): Distributed Databases Modern Database Management 10 th Edition Jeffrey.
Chapter 12 Distributed Data Bases. Learning Objectives What a distributed database management system (DDBMS) is and what its components are How database.
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 Management Systems. Reading Textbook: Ch. 1, Ch. 3 Textbook: Ch. 1, Ch. 3 For next class: Ch. 4 For next class: Ch. 4 FarkasCSCE.
 Distributed Database Concepts  Parallel Vs Distributed Technology  Advantages  Additional Functions  Distribution Database Design  Data Fragmentation.
Distributed DBMS, Query Processing and Optimization
Chapter 1 Database Access from Client Applications.
1 Chapter 22 Distributed DBMS Concepts and Design CS 157B Edward Chen.
Distributed DBMS Architecture Chapter 4 Principles Of Distributed Database Systems,2/e By Ozsu, Patrick Valduriez.
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.
Database Administration: The Complete Guide to Practices and Procedures Chapter 19 Data Movement and Distribution.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Lecture 11 Distributed Databases Modern Database Management 9 th Edition Jeffrey A. Hoffer,
DISTRIBUTED DATABASES AND DDBMS. Learning Objectives  Describe various DDBMS implementations  Explain how database design affects the DDBMS environment.
Distributed Databases
Distributed Databases
1 Chapter 22 Distributed DBMSs - Concepts and Design Simplified Transparencies © Pearson Education Limited 1995, 2005.
LM 9. Distributed Database Dr. Lei Li 1. Note: The content of the slides including figures are mainly based on a publicly available textbook chapter:
Distributed Databases
A View over Distributed databases
Introduction of Week 14 Return assignment 12-1
Presentation transcript:

1 Chapter 13: Distributed Databases

Chapter 13 2 Definitions Distributed Database: A single logical database that is spread physically across computers in multiple locations that are connected by a data communications link Distributed Database: A single logical database that is spread physically across computers in multiple locations that are connected by a data communications link Decentralized Database: A collection of independent databases on non- networked computers Decentralized Database: A collection of independent databases on non- networked computers They are NOT the same thing!

Chapter 13 3 Reasons for Distributed Database Business unit autonomy and distribution Business unit autonomy and distribution Data sharing Data sharing Data communication costs Data communication costs Data communication reliability and costs Data communication reliability and costs Multiple application vendors Multiple application vendors Database recovery Database recovery Transaction and analytic processing Transaction and analytic processing

Chapter 13 4 Distributed Database Options Homogeneous - Same DBMS at each node Homogeneous - Same DBMS at each node Autonomous - Independent DBMSsAutonomous - Independent DBMSs Non-autonomous - Central, coordinating DBMSNon-autonomous - Central, coordinating DBMS Easy to manage, difficult to enforceEasy to manage, difficult to enforce Heterogeneous - Different DBMSs at different nodes Heterogeneous - Different DBMSs at different nodes Systems – with full or partial DBMS functionalitySystems – with full or partial DBMS functionality Gateways - Simple paths are created to other databases without the benefits of one logical databaseGateways - Simple paths are created to other databases without the benefits of one logical database Difficult to manage, preferred by independent organizationsDifficult to manage, preferred by independent organizations

Chapter 13 5 Distributed Database Options Systems - Supports some or all functionality of one logical database Systems - Supports some or all functionality of one logical database Full DBMS Functionality - All dist. DB functionsFull DBMS Functionality - All dist. DB functions Partial-Multi-database - Some dist. DB functionsPartial-Multi-database - Some dist. DB functions Federated - Supports local databases for unique data requests Federated - Supports local databases for unique data requests Loose Integration - Local dbs have their own schemasLoose Integration - Local dbs have their own schemas Tight Integration - Local dbs use common schemaTight Integration - Local dbs use common schema Unfederated - Requires all access to go through a central, coordinating module Unfederated - Requires all access to go through a central, coordinating module

Chapter 13 6 Homogeneous, Non-Autonomous Database Data is distributed across all the nodes Data is distributed across all the nodes Same DBMS at each node Same DBMS at each node All data is managed by the distributed DBMS (no exclusively local data) All data is managed by the distributed DBMS (no exclusively local data) All access is through one, global schema All access is through one, global schema The global schema is the union of all the local schema The global schema is the union of all the local schema

Chapter 13 7 Typical Heterogeneous Environment Data distributed across all the nodes Data distributed across all the nodes Different DBMSs may be used at each node Different DBMSs may be used at each node Local access is done using the local DBMS and schema Local access is done using the local DBMS and schema Remote access is done using the global schema Remote access is done using the global schema

Chapter 13 8 Major Objectives Location Transparency Location Transparency User does not have to know the location of the data.User does not have to know the location of the data. Data requests automatically forwarded to appropriate sitesData requests automatically forwarded to appropriate sites Local Autonomy Local Autonomy Local site can operate with its database when network connections failLocal site can operate with its database when network connections fail Each site controls its own data, security, logging, recoveryEach site controls its own data, security, logging, recovery

Chapter 13 9 Significant Trade-Offs Synchronous Distributed Database Synchronous Distributed Database All copies of the same data are always identical All copies of the same data are always identical Data updates are immediately applied to all copies throughout networkData updates are immediately applied to all copies throughout network Good for data integrityGood for data integrity High overhead  slow response timesHigh overhead  slow response times Asynchronous Distributed Database Asynchronous Distributed Database Some data inconsistency is toleratedSome data inconsistency is tolerated Data update propagation is delayedData update propagation is delayed Lower data integrityLower data integrity Less overhead  faster response timeLess overhead  faster response time NOTE: all this assumes replicated data (to be discussed later)

Chapter Advantages of Distributed Database over Centralized Databases Increased reliability/availability Increased reliability/availability Local control over data Local control over data Modular growth Modular growth Lower communication costs Lower communication costs Faster response for certain queries Faster response for certain queries

Chapter Disadvantages of Distributed Database compared to Centralized databases Software cost and complexity Software cost and complexity Processing overhead Processing overhead Data integrity exposure Data integrity exposure Slower response for certain queries Slower response for certain queries

Chapter Options for Distributing a Database Data replication Data replication Copies of data distributed to different sitesCopies of data distributed to different sites Horizontal partitioning Horizontal partitioning Different rows of a table distributed to different sitesDifferent rows of a table distributed to different sites Vertical partitioning Vertical partitioning Different columns of a table distributed to different sitesDifferent columns of a table distributed to different sites Combinations of the above Combinations of the above

Chapter Data Replication Advantages - Advantages - ReliabilityReliability Fast responseFast response May avoid complicated distributed transaction integrity routines (if replicated data is refreshed at scheduled intervals)May avoid complicated distributed transaction integrity routines (if replicated data is refreshed at scheduled intervals) De-couples nodes (transactions proceed even if some nodes are down)De-couples nodes (transactions proceed even if some nodes are down) Reduced network traffic at prime time (if updates can be delayed)Reduced network traffic at prime time (if updates can be delayed)

Chapter Data Replication Disadvantages - Disadvantages - Additional requirements for storage spaceAdditional requirements for storage space Additional time for update operationsAdditional time for update operations Complexity and cost of updatingComplexity and cost of updating Integrity exposure of getting incorrect data if replicated data is not updated simultaneouslyIntegrity exposure of getting incorrect data if replicated data is not updated simultaneously Therefore, better when used for non-volatile (read-only) data

Chapter Types of Data Replication Push Replication – Push Replication – updating site sends changes to other sitesupdating site sends changes to other sites Pull Replication – Pull Replication – receiving sites control when update messages will be processedreceiving sites control when update messages will be processed

Chapter Types of Push Replication Snapshot Replication - Snapshot Replication - Changes periodically sent to master siteChanges periodically sent to master site Master collects updates in logMaster collects updates in log Full or differential (incremental) snapshotsFull or differential (incremental) snapshots Dynamic vs. shared update ownershipDynamic vs. shared update ownership Near Real-Time Replication - Broadcast update orders without requiring confirmationBroadcast update orders without requiring confirmation Done through use of triggersDone through use of triggers Update messages stored in message queue until processed by receiving siteUpdate messages stored in message queue until processed by receiving site

Chapter Issues for Data Replication Data timeliness – high tolerance for out-of- date data may be required Data timeliness – high tolerance for out-of- date data may be required DBMS capabilities – if DBMS cannot support multi-node queries, replication may be necessary DBMS capabilities – if DBMS cannot support multi-node queries, replication may be necessary Performance implications – refreshing may cause performance problems for busy nodes Performance implications – refreshing may cause performance problems for busy nodes Network heterogeneity – complicates replication Network heterogeneity – complicates replication Network communication capabilities – complete refreshes place heavy demand on telecommunications Network communication capabilities – complete refreshes place heavy demand on telecommunications

Chapter Horizontal Partitioning Different rows of a table at different sites Different rows of a table at different sites Advantages - Advantages - Data stored close to where it is used  efficiencyData stored close to where it is used  efficiency Local access optimization  better performanceLocal access optimization  better performance Only relevant data is available  securityOnly relevant data is available  security Unions across partitions  ease of queryUnions across partitions  ease of query Disadvantages Disadvantages Accessing data across partitions  inconsistent access speedAccessing data across partitions  inconsistent access speed No data replication  backup vulnerabilityNo data replication  backup vulnerability

Chapter Vertical Partitioning Different columns of a table at different sites Different columns of a table at different sites Advantages and disadvantages are the same as for horizontal partitioning except that combining data across partitions is more difficult because it requires joins (instead of unions) Advantages and disadvantages are the same as for horizontal partitioning except that combining data across partitions is more difficult because it requires joins (instead of unions)

Chapter Five Distributed Database Organizations ¬ Centralized database, distributed access ­ Replication with periodic snapshot update ® Replication with near real-time synchronization of updates ¯ Partitioned, one logical database ° Partitioned, independent, non-integrated segments

Chapter Factors in Choice of Distributed Strategy Funding, autonomy, security Funding, autonomy, security Site data referencing patterns Site data referencing patterns Growth and expansion needs Growth and expansion needs Technological capabilities Technological capabilities Costs of managing complex technologies Costs of managing complex technologies Need for reliable service Need for reliable service

Chapter Distributed DBMS Distributed database requires distributed DBMS Distributed database requires distributed DBMS Functions of a distributed DBMS: Functions of a distributed DBMS: Locate data with a distributed data dictionaryLocate data with a distributed data dictionary Determine location from which to retrieve data and process query componentsDetermine location from which to retrieve data and process query components DBMS translation between nodes with different local DBMSs (using middleware)DBMS translation between nodes with different local DBMSs (using middleware) Data consistency (via multiphase commit protocols)Data consistency (via multiphase commit protocols) Global primary key controlGlobal primary key control ScalabilityScalability Security, concurrency, query optimization, failure recoverySecurity, concurrency, query optimization, failure recovery

Chapter Local Transaction Steps 1. Application makes request to distributed DBMS 2. Distributed DBMS checks distributed data repository for location of data. Finds that it is local 3. Distributed DBMS sends request to local DBMS 4. Local DBMS processes request 5. Local DBMS sends results to application

Chapter Distributed DBMS Transparency Objectives Location Transparency Location Transparency User/application does not need to know where data residesUser/application does not need to know where data resides Replication Transparency Replication Transparency User/application does not need to know about duplicationUser/application does not need to know about duplication Failure Transparency Failure Transparency Either all or none of the actions of a transaction are committedEither all or none of the actions of a transaction are committed Each site has a transaction managerEach site has a transaction manager Logs transactions and before and after images Logs transactions and before and after images Concurrency control scheme to ensure data integrity Concurrency control scheme to ensure data integrity Requires special commit protocolRequires special commit protocol

Chapter Two-Phase Commit Prepare Phase Prepare Phase Coordinator receives a commit requestCoordinator receives a commit request Coordinator instructs all resource managers to get ready to “go either way” on the transaction. Each resource manager writes all updates from that transaction to its own physical logCoordinator instructs all resource managers to get ready to “go either way” on the transaction. Each resource manager writes all updates from that transaction to its own physical log Coordinator receives replies from all resource managers. If all are ok, it writes commit to its own log; if not then it writes rollback to its logCoordinator receives replies from all resource managers. If all are ok, it writes commit to its own log; if not then it writes rollback to its log

Chapter Two-Phase Commit Commit Phase Commit Phase Coordinator then informs each resource manager of its decision and broadcasts a message to either commit or rollback (abort). If the message is commit, then each resource manager transfers the update from its log to its databaseCoordinator then informs each resource manager of its decision and broadcasts a message to either commit or rollback (abort). If the message is commit, then each resource manager transfers the update from its log to its database A failure during the commit phase puts a transaction “in limbo.” This has to be tested for and handled with timeouts or pollingA failure during the commit phase puts a transaction “in limbo.” This has to be tested for and handled with timeouts or polling

Chapter Concurrency Control Concurrency Transparency Design goal for distributed databaseDesign goal for distributed database Timestamping Timestamping Concurrency control mechanismConcurrency control mechanism Alternative to locks in distributed databasesAlternative to locks in distributed databases

Chapter Query Optimization In a query involving a multi-site join and, possibly, a distributed database with replicated files, the distributed DBMS must decide where to access the data and how to proceed with the join. Three step process: In a query involving a multi-site join and, possibly, a distributed database with replicated files, the distributed DBMS must decide where to access the data and how to proceed with the join. Three step process: 1Query decomposition - rewritten and simplified 2Data localization - query fragmented so that fragments reference data at only one site 3Global optimization - Order in which to execute query fragments Order in which to execute query fragments Data movement between sites Data movement between sites Where parts of the query will be executed Where parts of the query will be executed

Chapter Evolution of Distributed DBMS “Unit of Work” - All of a transaction’s steps. “Unit of Work” - All of a transaction’s steps. Remote Unit of Work Remote Unit of Work SQL statements originated at one location can be executed as a single unit of work on a single remote DBMSSQL statements originated at one location can be executed as a single unit of work on a single remote DBMS

Chapter Evolution of Distributed DBMS Distributed Unit of Work Distributed Unit of Work Different statements in a unit of work may refer to different remote sitesDifferent statements in a unit of work may refer to different remote sites All databases in a single SQL statement must be at a single siteAll databases in a single SQL statement must be at a single site Distributed Request Distributed Request A single SQL statement may refer to tables in more than one remote siteA single SQL statement may refer to tables in more than one remote site May not support replication transparency or failure transparencyMay not support replication transparency or failure transparency