Slide 1Distributed Database SystemAdvantages of DistributionArchitecture Design ConsiderationsArchitecture AlternativesTypes of Distributed SystemsSoftware Components of DDBMSDDBMS FunctionsData Placement AlternativesFactors in Data Placement DecisionTypes of TransparencyTransaction Management for DDBMSLocking ProtocolsGlobal Deadlock DetectionTimestamping ProtocolsRecovery-FailuresHandling Node FailureCommit ProtocolsDistributed Query ProcessingSteps in Distributed Query-1Steps in Distributed Query-2CSC 3800 Database Management SystemsTime: 1:30 to 2:20 Meeting Days: MWF Location: Oxendine 1237BTextbook: Databases Illuminated, Author: Catherine M. Ricardo, 2004, Jones & Bartlett PublishersFall 2009Chapter 12Distributed DatabasesDr. Chuck LillieDistributed Database Distributed Database SystemSystemMultiple sites connected by a communications systemData at any site available to users at other sites Sites may be far apart; linked by telecommunications linesMay be close together; linked by a local area networkAdvantages of DistributionAdvantages of DistributionCompared to a single, centralized system that provides remote access, distributed system advantages are◦Local autonomy◦Improved reliability◦Better data availability◦Increased performance◦Reduced response time◦Lower communications costsArchitecture Design Architecture Design ConsiderationsConsiderationsFactors the designer considers in choosing an architecture for a distributed system ◦Type of communications system◦Data models supported◦Types of applications◦Data placement alternativesArchitecture AlternativesArchitecture AlternativesCentralized database with distributed processing Client-server systemParallel databases◦Shared memory◦Shared disk◦Shared nothing◦Cluster true distributed database-data and processing shared among autonomous sitesTypes of Distributed Types of Distributed SystemsSystemsHomogeneous◦All nodes use the same hardware and softwareHeterogeneous◦Nodes have different hardware or software◦Require translations of codes and word lengths due to hardware differences◦Translation of data models and data structures due to software differencesSoftware Components of Software Components of DDBMSDDBMSData communications component (DC)Local database management system (DBMS)Global data dictionary (GDD)Distributed database management system component (DDBMS)Not all sites have all these componentsDDBMS FunctionsDDBMS FunctionsProvides the user interface◦Needed for location transparencyLocates the data◦Directs queries to proper site(s)Processes queries◦Local, remote, compound (global)Provides network-wide concurrency control and recovery proceduresProvides translation in heterogeneous systemsData Placement Data Placement AlternativesAlternativesCentralized◦All data at one site onlyReplicated◦All data duplicated at all sitesPartitioned◦Data divided among sites◦Fragmentation scheme: horizontal, vertical, mixed fragments◦Each item appears only onceHybrid◦Combination of the othersFactors in Data Placement Factors in Data Placement DecisionDecisionLocality of referenceReliability of dataAvailability of dataStorage capacities and costsDistribution of processing loadCommunications costsTypes of TransparencyTypes of TransparencyData distribution transparency◦Fragmentation transparency◦Location transparency◦Replication transparencyDBMS heterogeneity transparencyTransaction transparency◦Concurrency transparency◦Recovery transparencyPerformance transparencyTransaction Management for Transaction Management for DDBMSDDBMSEach site that initiates transactions has a transaction coordinator to manage transactions that originate there◦For local or remote transactions, transaction manager at data site takes over◦For global transactions, originating site coordinatorStarts executionUses GDD to form sub-transactionsDirects sub-transactions to appropriate sitesReceives sub-transaction resultsControls transaction end-either commit or abort at all sitesAdditional concurrency control problem◦Multiple-copy inconsistency problemSolutions use locking and timestampingLocking ProtocolsLocking ProtocolsExtension of two-phase locking protocol◦Single-site lock managerMay use Read-One-Write-All replica handlingSite may become a bottleneck◦Distributed lock managerCan use Read-One-Write-All methodDeadlock difficult to determine◦Primary copyDominant node for each data item◦Majority lockingGlobal Deadlock DetectionGlobal Deadlock DetectionEach site has local wait-for graph-detects only local deadlockNeed global wait-for graph◦Single site can be global deadlock detection coordinator◦Constructs global graph and checks for cycles◦Responsibility could be shared among sitesTimestamping ProtocolsTimestamping ProtocolsOne site could issue all timestampsInstead, multiple sites could issue them◦Each timestamp has two parts-the time and the node identifier◦Guarantees uniqueness of timestamps◦Difficult to synchronize clocks-to control divergence, can advance clock reading if later timestamp received◦Can apply basic timestamping, Thomas’ Write Rule, multi-version timestamp protocols using unique timestampsRecovery-FailuresRecovery-FailuresMust guarantee atomicity and durability of transactionsFailures include usual types, plus loss of messages, site failure, link failureNetwork partitioning◦Failure where network splits into groups of nodes that are isolated from other groups, but can communicate with one anotherHandling Node FailureHandling Node FailureSystem flags node as failedSystem aborts and rolls back affected transactionsSystem checks periodically to see if node has recovered, or node self-reportsAfter restart, failed node does local recoveryFailed node catches up to current state of DB, using system log of changes made while it was unavailableCommit ProtocolsCommit ProtocolsTwo-phase commit protocl◦Phase 1-voting phaseCoordinator writes <begin commit T> to its log, writes log to disk, sends <prepare T> msg to all participants. Each site either does a <ready T> or <abort T> and sends its vote to coordinator◦Phase 2-resolution phaseCoordinator resolves fate of transactionIf any abort msg received, makes all sites abortFailure of any site to vote generates global
View Full Document