ENTERPRISE PROGRAMMING

Slides:



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

Distributed DBMSs – Concepts and Design Chapter 22 in Textbook.
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
Transaction.
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.
Manajemen Basis Data Pertemuan 9 Matakuliah: M0264/Manajemen Basis Data Tahun: 2008.
1 Minggu 12, Pertemuan 23 Introduction to Distributed DBMS (Chapter , 22.6, 3rd ed.) Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
Distributed Database Management Systems
Overview Distributed vs. decentralized Why distributed databases
Distributed Databases
©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
©Silberschatz, Korth and Sudarshan18.1Database System Concepts Centralized Systems Run on a single computer system and do not interact with other computer.
Definition of terms Definition of terms Explain business conditions driving distributed databases Explain business conditions driving distributed databases.
Distributed databases
Alexandria Dodd Janelle Toungett
DATABASE MANAGEMENT SYSTEMS 2 ANGELITO I. CUNANAN JR.
Distributed Databases
Distributed Databases and DBMSs: Concepts and Design
Distributed DBMSs - Concepts and Design Transparencies
1 Distributed and Parallel Databases. 2 Distributed Databases Distributed Systems goal: –to offer local DB autonomy at geographically distributed locations.
12 1 Chapter 12 Distributed Database Management Systems Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Distributed DBMSs - Concepts and Design Transparencies
Database Design – Lecture 16
III. Current Trends: 1 - Distributed DBMSsSlide 1/32 III. Current Trends Part 1: Distributed DBMSs: Concepts and Design Lecture 12 (2 hours) Lecturer:
DISTRIBUTED DATABASES IN ADBMS Shilpa Seth
04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Distributed Database Systems.
Session-9 Data Management for Decision Support
Distributed and mobile DBMSs Transparencies. ©Pearson Education 2009 Chapter 16 - Objectives Main concepts of distributed DBMSs (DDBMSs) Differences between.
Lecture 5: Sun: 1/5/ Distributed Algorithms - Distributed Databases Lecturer/ Kawther Abas CS- 492 : Distributed system &
Session-8 Data Management for Decision Support
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 systems and Distributed databases design Enterprise systems DT
Distributed Database Systems Overview
Multiprossesors Systems.. What are Distributed Databases ? “ A Logically interrelated collection of shared data ( and a description of this data) physically.
DDBMS Distributed Database Management Systems Fragmentation
Distributed DBMSs- Concept and Design Jing Luo CS 157B Dr. Lee Fall, 2003.
Distributed Databases
ASMA AHMAD 28 TH APRIL, 2011 Database Systems Distributed Databases I.
1 Distributed Databases BUAD/American University Distributed Databases.
Databases Illuminated
Distributed Database. Introduction A major motivation behind the development of database systems is the desire to integrate the operational data of an.
Distributed Database System
Distributed database system
Topic Distributed DBMS Database Management Systems Fall 2012 Presented by: Osama Ben Omran.
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
1 Lecture 10: Distributed Databases – Replication and Fragmentation Advanced Databases CG096 Nick Rossiter.
1 Lecture 8 Distributed Data Bases: Replication and Fragmentation.
1 Chapter 22 Distributed DBMS Concepts and Design CS 157B Edward Chen.
Chapter 24 Distributed DBMSs – Concepts and Design Pearson Education © 2014.
Distributed Database Design Bayu Adhi Tama, MTI Fasilkom-Unsri Adapted from Connolly, et al., Database Systems 4 th Edition, Pearson Education Limited,
1 Information Retrieval and Use De-normalisation and Distributed database systems Geoff Leese September 2008, revised October 2009.
Distributed DBMSs – Concepts and Design Chapter 24 in Textbook.
CMS Advanced Database and Client-Server Applications Distributed Databases slides by Martin Beer and Paul Crowther Connolly and Begg Chapter 22.
Distributed Databases
1 Chapter 22 Distributed DBMSs - Concepts and Design Simplified Transparencies © Pearson Education Limited 1995, 2005.
Distributed DBMSs - Concepts and Design
Distributed Database Concepts
Distributed DBMS Concepts of Distributed DBMS
Chapter 19: Distributed Databases
Distributed Databases and DBMSs: Concepts and Design
Distributed Databases
Presentation transcript:

ENTERPRISE PROGRAMMING Distributed DBMSs – Concepts and Design

DISTRIBUTED DATABASE SYSTEMS Concepts. Advantages and disadvantages of distributed databases. Functions and architecture for a DDBMS. Distributed database design. Levels of transparency. Comparison criteria for DDBMSs.

Concepts Distributed Database A logically interrelated collection of shared data (and a description of this data), physically distributed over a computer network. Distributed DBMS Software system that permits the management of the distributed database and makes the distribution transparent to users.

Concepts Collection of logically-related shared data. Data split into fragments. Fragments may be replicated. Fragments/replicas allocated to sites. Sites linked by a communications network. Data at each site is under control of a DBMS. DBMSs handle local applications autonomously. Each DBMS participates in at least one global application.

Those that do not require data from other sites. GLOBAL APPLICATION CONCEPTS LOCAL APPLICATION Those that do not require data from other sites. GLOBAL APPLICATION Those that requires data from other sites.

STRUCTURE OF DISTRIBUTED DATABASE A distributed database system consists of a collection of sites, each of which maintain a local database system. Each site is able to process local transactions, those transactions that access data only in a single site In addition a site may participate in the execution of global transactions, those transaction that access data in several sites. The execution of global transactions requires communication along the sites.

STRUCTURE OF THE DISTRIBUTED DATABASES The sites in the system can be connected physically in a variety of ways. The major differences among these configurations involve: Installation cost: The cost of physically linking the site Communication Cost: - The cost in time and money from sending a message from site A to site B Reliability : The frequency with which a link or site fails Availability : The degree to which data can be accessed despite the failure of some links or sites.

Distributed DBMS © Pearson Education Limited 1995, 2005

Illustration of concepts Consider a banking system consisting of four (4) branches located in Amman, Nablus, Jenin and Ramallah. Each branch has its own computer with a database consisting of accounts maintained at that branch. Each such installation is a site. There exists one single site (headquarters, Amman) which maintains information about all branches.

Illustration of concepts Each branch maintains (among others) a relation deposit (Deposit-Scheme) where: Deposit-Scheme = (branch-name, account- number, customer-name, balance) The site containing information about the four branches maintains the relation branch (Branch-scheme), where: Branch-scheme = (branch-name, assets, branch-city) There are other relations which are ignored for purposes of our example.

Illustration of concepts Consider the transaction to add JD 50 to account number 177 located at Nablus. If the transaction was initiated at Nablus branch, then it is considered local; otherwise, it is considered global. A transaction to transfer JD 50 from account 177 to account 305, which is located at Ramallah Branch, is a global branch, since accounts in two different sites are accessed as a result of its execution.

Illustration of concepts What makes the example a distributed database system ? The four sites are aware of each other Each branch provides an environment for executing both local and global transactions. For now assume that each site is running the same distributed database management software.

OBJECTIVES OF DISTRIBUTED DATABASE A major objective of distributed databases is to provide ease of access to data for users at many different locations. The distributed database system must provide what is called location transparency:- a user (or user program) using data need not know the location of the data. Ideally the user is unaware of the distribution of data, and all data in the network appear as single logical database stored at one site. In ideal case, a single query can join data from tables in multiple sites as if the data were all in one site.

OBJECTIVE OF DISTRIBUTED DATABASE A second objective of distributed database is local autonomy. This is the capability to administer a local database and to operate independently when connection to other nodes have failed. Each site has the ability to control local data, administer security, log transactions, recover when local failures occur ad provide full access to local data to local users when any central or coordinating site cannot operate. There is no reliance on central site.

Distributed Processing A centralized database that can be accessed over a computer network.

Parallel DBMS A DBMS running across multiple processors and disks designed to execute operations in parallel, whenever possible, to improve performance. Based on premise that single processor systems can no longer meet requirements for cost-effective scalability, reliability, and performance. Parallel DBMSs link multiple, smaller machines to achieve same throughput as single, larger machine, with greater scalability and reliability.

Parallel DBMS Main architectures for parallel DBMSs are: Shared memory: Tightly coupled architecture in which multiple processors within a single system share system memory Shared disk: Is a loosely-coupled architecture optimized for applications that are inherently centralized and require high availability and performance. Shared disks are sometimes referred to as clusters. Shared nothing: Often known as massively parallel processing (MPP), is a multiple processor architecture in which each processor is part of a complete system, with its own memory and disk storage. The database is partitioned among all disks on each system associated with the database, and data is transparently available to users on all systems.

Parallel DBMS (a) shared memory (b) shared disk (c) shared nothing © Pearson Education Limited 1995, 2005

Advantages of DDBMSs Reflects organizational structure Improved shareability and local autonomy Improved availability Availability is the probability that the system is continuously available during a time interval. Improved reliability The probability that a system is running (not down) at certain point in time.

Advantages of DDBMS Improved performance Data is kept closer to where it is needed most. Data localization reduces the contention for CPU and I/O services and simultaneously reduces access delays involved in wide area networks. Smaller databases exist at each site. As a result, local queries and transactions accessing data at a single site have better performance because of the smaller databases. Inter-query and intra-query parallelism can be achieved by executing multiple queries at different sites.

Advantages of DDBMS Economics Modular growth Expansion of system in terms of adding more data, increasing database sizes or adding more processors is much easier.

Disadvantages of DDBMSs Complexity Cost Security Integrity control more difficult Lack of standards Lack of experience Database design more complex

Types of DDBMS Homogeneous DDBMS Heterogeneous DDBMS

Homogeneous DDBMS All sites use same DBMS product. Much easier to design and manage. Approach provides incremental growth and allows increased performance.

Heterogeneous DDBMS Sites may run different DBMS products, with possibly different underlying data models. Occurs when sites have implemented their own databases and integration is considered later. Translations required to allow for: Different hardware. Different DBMS products. Different hardware and different DBMS products. Typical solution is to use gateways.

Multidatabase System (MDBS) DDBMS in which each site maintains complete autonomy. DBMS that resides transparently on top of existing database and file systems and presents a single database to its users. Allows users to access and share data without requiring physical database integration. Un-federated MDBS (no local users) and federated MDBS. © Pearson Education Limited 1995, 2005

Overview of Networking Network - Interconnected collection of autonomous computers, capable of exchanging information. Local Area Network (LAN) intended for connecting computers at same site. Wide Area Network (WAN) used when computers or LANs need to be connected over long distances. WAN relatively slow and less reliable than LANs. DDBMS using LAN provides much faster response time than one using WAN.

Overview of Networking

Functions of a DDBMS Expect DDBMS to have at least the functionality of a DBMS. Also to have following functionality: Extended communication services. Extended Data Dictionary. Distributed query processing. Extended concurrency control. Extended recovery services.

Reference Architecture for DDBMS Due to diversity, no accepted architecture equivalent to ANSI/SPARC 3-level architecture. A reference architecture consists of: Set of global external schemas. Global conceptual schema (GCS). A logical description of the whole database as if it were not distributed. Corresponds to the conceptual schema in the ANSI-SPARC architecture. Contains definitions of entities, relationships, constraints , securities and integrity information. Fragmentation schema and allocation schema. Description of how data is to be logically partitioned Set of schemas for each local DBMS conforming to 3-level ANSI/SPARC. Each local DBMS has its own set of schemas. Some levels may be missing, depending on levels of transparency supported.

Reference Architecture for DDBMS

Reference Architecture for MDBS In DDBMS, GCS is union of all local conceptual schemas. In FMDBS, GCS is subset of local conceptual schemas (LCS), consisting of data that each local system agrees to share. GCS of tightly coupled system involves integration of either parts of LCSs or local external schemas. FMDBS with no GCS is called loosely coupled.

Reference Architecture for Tightly-Coupled FMDBS

COMPONENT ARCHITECTURE FOR A DBMS Consist of 4 major components Local DBMS (LDBMS) Standard DBMS responsible for controlling the local data at each site that has a database. Has its own system catalog that stores information about data held at that site. DATA COMMUNICATION COMPONENT (DC) The DC component is the software that enables all the sites to communicate with each other. Contains information about links and sites. GLOBAL SYSTEM CATALOGUE (GSC) Same functionality as the system catalogue of a centralized system. GSC holds information specific to the distributed nature of the system, such as fragmentation, allocation, replication and allocation schemas. A fully replicated GSC compromises site autonomy as every modification to the GSC has to be communicated to all other sites. A centralized GSC also compromises site autonomy and is vulnerable to failure of the site. DISTRIBUTED DBMS COMPONENT This is the controlling unit of the entire system.

Components of a DDBMS

Distributed Database Design Three key issues: Fragmentation, Allocation, Replication.

Distributed Database Design Fragmentation Relation may be divided into a number of sub-relations, which are then distributed. 2 types:-Horizontal are subsets of tuples and vertical are subsets of attributes Allocation Each fragment is stored at site with “optimal” distribution. Replication Copy of fragment may be maintained at several sites.

Fragmentation Definition and allocation of fragments carried out strategically to achieve: Locality of Reference. Improved Reliability and Availability. Improved Performance. Balanced Storage Capacities and Costs. Minimal Communication Costs. Involves analyzing most important applications, based on quantitative/qualitative information. © Pearson Education Limited 1995, 2005

Fragmentation Quantitative information may include: frequency with which an application is run; site from which an application is run; performance criteria for transactions and applications. Qualitative information may include transactions that are executed by application, type of access (read or write), and predicates of read operations.

Data Allocation Four alternative strategies regarding placement of data: Centralized, Partitioned (or Fragmented), Complete Replication, Selective Replication.

Data Allocation Centralized: Consists of single database and DBMS stored at one site with users distributed across the network. Partitioned: Database partitioned into disjoint fragments, each fragment assigned to one site. Complete Replication: Consists of maintaining complete copy of database at each site. Selective Replication: Combination of partitioning, replication, and centralization.

Comparison of Strategies for Data Distribution

Why Fragment? Usage Applications work with views rather than entire relations. Efficiency Data is stored close to where it is most frequently used. Data that is not needed by local applications is not stored.

Why Fragment? Parallelism With fragments as unit of distribution, transaction can be divided into several subqueries that operate on fragments. Security Data not required by local applications is not stored and so not available to unauthorized users.

Why Fragment? Disadvantages Performance, Integrity.

Correctness of Fragmentation Three correctness rules: Completeness, Reconstruction, Disjointness.

Correctness of Fragmentation Completeness If relation R is decomposed into fragments R1, R2, ... Rn, each data item that can be found in R must appear in at least one fragment. Reconstruction Must be possible to define a relational operation that will reconstruct R from the fragments. Reconstruction for horizontal fragmentation is Union operation and Join for vertical .

Correctness of Fragmentation Disjointness If data item di appears in fragment Ri, then it should not appear in any other fragment. Exception: vertical fragmentation, where primary key attributes must be repeated to allow reconstruction. For horizontal fragmentation, data item is a tuple. For vertical fragmentation, data item is an attribute.

Types of Fragmentation Four types of fragmentation: Horizontal, Vertical, Mixed, Derived. Other possibility is no fragmentation: If relation is small and not updated frequently, may be better not to fragment relation.

Horizontal and Vertical Fragmentation

Mixed Fragmentation

Horizontal Fragmentation Consists of a subset of the tuples of a relation. Defined using Selection operation of relational algebra: p(R) For example: P1 =  type=‘House’(PropertyForRent) P2 =  type=‘Flat’(PropertyForRent)

Horizontal Fragmentation This strategy is determined by looking at predicates used by transactions. Involves finding set of minimal (complete and relevant) predicates. Set of predicates is complete, if and only if, any two tuples in same fragment are referenced with same probability by any application. Predicate is relevant if there is at least one application that accesses fragments differently.

Fragmentation Example In the PropertyForRent table If the only requirement is to select tuples from PropertyForRent based on the property type, the set {type = ‘House’, type=‘Flat’} is complete. The set {type = ‘House’} is not complete With this requirement, the predicate (city=‘Aberdeen’) would not be relevant.

Vertical Fragmentation Consists of a subset of attributes of a relation. Defined using Projection operation of relational algebra: a1, ... ,an(R) For example: S1 = staffNo, position, sex, DOB, salary(Staff) S2 = staffNo, fName, lName, branchNo(Staff) Determined by establishing affinity of one attribute to another.

Mixed Fragmentation Consists of a horizontal fragment that is vertically fragmented, or a vertical fragment that is horizontally fragmented. Defined using Selection and Projection operations of relational algebra:  p(a1, ... ,an(R)) or a1, ... ,an(σp(R))

Example - Mixed Fragmentation S1 = staffNo, position, sex, DOB, salary(Staff) S2 = staffNo, fName, lName, branchNo(Staff) S21 =  branchNo=‘B003’(S2) S22 =  branchNo=‘B005’(S2) S23 =  branchNo=‘B007’(S2)

Derived Horizontal Fragmentation A horizontal fragment that is based on horizontal fragmentation of a parent relation. Ensures that fragments that are frequently joined together are at same site. Defined using Semijoin operation of relational algebra: Ri = R F Si, 1  i  w

Example - Derived Horizontal Fragmentation S3 =  branchNo=‘B003’(Staff) S4 =  branchNo=‘B005’(Staff) S5 =  branchNo=‘B007’(Staff) Could use derived fragmentation for Property: Pi = PropertyForRent branchNo Si, 3  i  5

Derived Horizontal Fragmentation If relation contains more than one foreign key, need to select one as parent. Choice can be based on fragmentation used most frequently or fragmentation with better join characteristics.

Distributed Database Design Methodology Use normal methodology to produce a design for the global relations. Examine topology of system to determine where databases will be located. Analyze most important transactions and identify appropriateness of horizontal/vertical fragmentation. Decide which relations are not to be fragmented. Examine relations on 1 side of relationships and determine a suitable fragmentation schema. Relations on many side may be suitable for derived fragmentation.

Transparencies in a DDBMS Distribution Transparency Fragmentation Transparency Location Transparency Replication Transparency Local Mapping Transparency Naming Transparency

Transparencies in a DDBMS Transaction Transparency Concurrency Transparency Failure Transparency Performance Transparency DBMS Transparency

Distribution Transparency Distribution transparency allows user to perceive database as single, logical entity. If DDBMS exhibits distribution transparency, user does not need to know: data is fragmented (fragmentation transparency), location of data items (location transparency), otherwise call this local mapping transparency. With replication transparency, user is unaware of replication of fragments .

Naming Transparency Each item in a DDB must have a unique name. DDBMS must ensure that no two sites create a database object with same name. One solution is to create central name server. However, this results in: loss of some local autonomy; central site may become a bottleneck; low availability; if the central site fails, remaining sites cannot create any new objects.

Naming Transparency Alternative solution - prefix object with identifier of site that created it. For example, Branch created at site S1 might be named S1.BRANCH. Also need to identify each fragment and its copies. Thus, copy 2 of fragment 3 of Branch created at site S1 might be referred to as S1.BRANCH.F3.C2. However, this results in loss of distribution transparency.

Naming Transparency An approach that resolves these problems uses aliases for each database object. Thus, S1.BRANCH.F3.C2 might be known as LocalBranch by user at site S1. DDBMS has task of mapping an alias to appropriate database object.

Transaction Transparency Ensures that all distributed transactions maintain distributed database’s integrity and consistency. Distributed transaction accesses data stored at more than one location. Each transaction is divided into number of subtransactions, one for each site that has to be accessed. DDBMS must ensure the indivisibility of both the global transaction and each of the subtransactions.

Example - Distributed Transaction T prints out names of all staff, using schema defined above as S1, S2, S21, S22, and S23. Define three subtransactions TS3, TS5, and TS7 to represent agents at sites 3, 5, and 7.

Concurrency Transparency All transactions must execute independently and be logically consistent with results obtained if transactions executed one at a time, in some arbitrary serial order. Same fundamental principles as for centralized DBMS. DDBMS must ensure both global and local transactions do not interfere with each other. Similarly, DDBMS must ensure consistency of all subtransactions of global transaction.

Classification of Transactions In IBM’s Distributed Relational Database Architecture (DRDA), four types of transactions: Remote request Remote unit of work Distributed unit of work Distributed request.

Classification of Transactions

Concurrency Transparency Replication makes concurrency more complex. If a copy of a replicated data item is updated, update must be propagated to all copies. Could propagate changes as part of original transaction, making it an atomic operation. However, if one site holding copy is not reachable, then transaction is delayed until site is reachable.

Concurrency Transparency Could limit update propagation to only those sites currently available. Remaining sites updated when they become available again. Could allow updates to copies to happen asynchronously, sometime after the original update. Delay in regaining consistency may range from a few seconds to several hours.

Failure Transparency DDBMS must ensure atomicity and durability of global transaction. Means ensuring that subtransactions of global transaction either all commit or all abort. Thus, DDBMS must synchronize global transaction to ensure that all subtransactions have completed successfully before recording a final COMMIT for global transaction. Must do this in presence of site and network failures.

Performance Transparency DDBMS must perform as if it were a centralized DBMS. DDBMS should not suffer any performance degradation due to distributed architecture. DDBMS should determine most cost-effective strategy to execute a request.

Performance Transparency Distributed Query Processor (DQP) maps data request into ordered sequence of operations on local databases. Must consider fragmentation, replication, and allocation schemas. DQP has to decide: which fragment to access; which copy of a fragment to use; which location to use.

Performance Transparency DQP produces execution strategy optimized with respect to some cost function. Typically, costs associated with a distributed request include: I/O cost; CPU cost; communication cost.

Performance Transparency - Example Property(propNo, city) 10000 records in London Client(clientNo,maxPrice) 100000 records in Glasgow Viewing(propNo, clientNo) 1000000 records in London SELECT p.propNo FROM Property p INNER JOIN (Client c INNER JOIN Viewing v ON c.clientNo = v.clientNo) ON p.propNo = v.propNo WHERE p.city=‘Aberdeen’ AND c.maxPrice > 200000;

Performance Transparency - Example Assume: Each tuple in each relation is 100 characters long. 10 renters with maximum price greater than £200,000. 100 000 viewings for properties in Aberdeen. Computation time negligible compared to communication time.

Performance Transparency - Example

Date’s 12 Rules for a DDBMS 0. Fundamental Principle To the user, a distributed system should look exactly like a nondistributed system. 1. Local Autonomy 2. No Reliance on a Central Site 3. Continuous Operation 4. Location Independence 5. Fragmentation Independence 6. Replication Independence

Date’s 12 Rules for a DDBMS 7. Distributed Query Processing 8. Distributed Transaction Processing 9. Hardware Independence 10. Operating System Independence 11. Network Independence 12. Database Independence Last four rules are ideals. END OF CLASS