Published on

Navate Database Management system

  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide


  1. 2. <ul><li>Distributed </li></ul><ul><li>Databases </li></ul><ul><li>and </li></ul><ul><li>Client-Server </li></ul><ul><li>Architectures </li></ul>Chapter 25
  2. 3. <ul><li>Distributed Database Concepts </li></ul><ul><li>Data Fragmentation, Replication, and Allocation Techniques for Distributed Database Design </li></ul><ul><li>Types of Distributed Database Systems </li></ul><ul><li>Query Processing in Distributed Databases </li></ul><ul><li>Overview of Concurrency Control and Recovery in Distributed Databases </li></ul><ul><li>Distributed Databases in Oracle </li></ul>Chapter Outline
  3. 4. <ul><li>A number of processing elements that are interconnected by a computer network and cooperate in performing certain assigned tasks is called a distributed computing system . </li></ul><ul><li>A distributed computing system partitions a big problem into small pieces and and solve it efficiently in a coordinate manner. </li></ul><ul><li>There are two types of multiprocessor systems: </li></ul><ul><ul><li>Shared memory (tightly coupled) architecture – share secondary storage (disk) and primary memory </li></ul></ul><ul><ul><li>Shared disk (loosely coupled) architecture – share secondary storage, but each has their own primary memory </li></ul></ul>Distributed Database Concepts
  4. 5. <ul><li>A Distributed Database (DDB) is a collection of multiple logically interrelated databases distributed over a computer network. </li></ul><ul><li>A Distributed Database Management System (DDBMS) refers to a software system that manages a DDB. </li></ul><ul><li>Database management systems developed using multiprocessor architectures are called parallel database management systems. </li></ul><ul><li>In shared nothing architecture every processor has its own primary and secondary memory. </li></ul>Distributed Database Concepts
  5. 6. <ul><li>FIGURE 25.1 Some different database system architectures. </li></ul><ul><li>Shared nothing architecture. </li></ul>Distributed Database Concepts
  6. 7. <ul><li>FIGURE 25.1 (continued) </li></ul><ul><li>Some different database system architectures. </li></ul><ul><li>(b) A networked architecture with a centralized database at one of the sites. </li></ul>Distributed Database Concepts
  7. 8. <ul><li>FIGURE 25.1 (continued) </li></ul><ul><li>Some different database system architectures. </li></ul><ul><li>(c) A truly distributed database architecture. </li></ul>Distributed Database Concepts
  8. 9. <ul><li>Advantages of distributed databases: </li></ul><ul><ul><li>Management of distributed data with different levels of transparency: hiding the details of where each file (able, relation) is physically stored within the system. The possible types of transparency are: </li></ul></ul><ul><ul><ul><li>Distribution or network transparency – freedom for the user from the operational details of the network. It can be divided into location and naming transparency. </li></ul></ul></ul><ul><ul><ul><li>Replication transparency – makes the user unaware of the existence of copies. </li></ul></ul></ul><ul><ul><ul><li>Fragmentation transparency – makes the user unaware of the existence of fragments. </li></ul></ul></ul>Advantages of Distributed Databases
  9. 10. <ul><ul><li>Increased reliability and availability: two of the most common potential advantages cited for DDB: </li></ul></ul><ul><ul><ul><li>Reliability – the probability that a system is running (not down) at a certain time point, </li></ul></ul></ul><ul><ul><ul><li>Availability – the probability that the system is continuously available during a time interval. </li></ul></ul></ul><ul><ul><li>Improved performance: a DDBMS fragments the database by keeping the data closer to where it is needed most (data localization reduces CPU and I/O). </li></ul></ul><ul><ul><li>Easier expansion: adding more data, increasing database sizes, or adding more processors is much easier in a DDB . </li></ul></ul>Advantages of Distributed Databases
  10. 11. <ul><ul><li>FIGURE 25.2 Data distribution and replication among distributed databases. </li></ul></ul>Advantages of Distributed Databases
  11. 12. <ul><li>A DDBMS must provide the following functions: </li></ul><ul><ul><li>Keeping track of data: the ability to keep track of the data distribution, fragmentation, and replication, </li></ul></ul><ul><ul><li>Distributed query processing: the ability to access remote sites via a communication network, </li></ul></ul><ul><ul><li>Distributed transaction management: the ability to execute transactions that access data from many sites, </li></ul></ul><ul><ul><li>Replicated data management: the ability to decide which copy of a replicated data to access and maintain the consistency of copies of replicated data items, </li></ul></ul>Additional Functions of DDB
  12. 13. <ul><li>(cont.) </li></ul><ul><ul><li>Distributed database recovery: the ability to recover from individual site crashes (or communication failure), </li></ul></ul><ul><ul><li>Security: proper management of the security of the data and the authorization/access privileges of users, </li></ul></ul><ul><ul><li>Distributed directory (catalog) management: design and policy issues for the placement of directory. </li></ul></ul>Additional Functions of DDB
  13. 14. <ul><li>Techniques that are used to break up a database into logical units, called fragmentation . </li></ul><ul><li>Data replication permits certain data to be stored in more than one site, and the process of allocating fragments . </li></ul><ul><li>Information concerning data fragmentation, allocation, and replication is stored in a global directory that is accessed by the DDB applications as needed. </li></ul>Data Fragmentation, Replication
  14. 15. <ul><li>In a DDB, decisions must be made regarding which site should contain which portion of the DB </li></ul><ul><li>A horizontal fragment of a relation is a subset of the tuples in the relation (e.g., DNO=5). </li></ul><ul><li>A vertical fragment of a relation keeps only certain attributes of a relation (e.g., SSN, SEX). </li></ul><ul><li>A mixed (hybrid) fragment of a relation combines the horizontal and vertical fragmentations. </li></ul>Data Fragmentation, Replication
  15. 16. <ul><li>A horizontal fragment of a relation R can be specified by a σ ci (R). </li></ul><ul><li>A set of horizontal fragments whose conditions C 1 , C 2 , …, C n include all the tuples in R is called a complete horizontal fragmentation of R. </li></ul><ul><li>A vertical fragment of a relation R can be specified by a π Li (R). </li></ul><ul><li>A set of vertical fragments whose projection lists L 1 , L 2 , …, L n include all the attributes in R but share only the primary key attribute of R is called a complete vertical fragmentation of R. </li></ul>Data Fragmentation, Replication
  16. 17. <ul><li>Replication is useful in improving the availability of data. </li></ul><ul><li>In a fully replicated distributed database the whole database is replicated at every site. </li></ul><ul><li>The other extreme to full replication involves having no replication (i.e., each fragment is stored at exactly one site). </li></ul><ul><li>In partial replication of the data, some fragments of the database ma be replicated whereas others may not. </li></ul>Data Fragmentation, Replication
  17. 18. <ul><li>FIGURE 25.3 Allocation of fragments to sites. </li></ul><ul><li>Relation fragments at site 2 corresponding to department 5. </li></ul>Data Fragmentation, Replication
  18. 19. <ul><li>FIGURE 25.3 (continued) Allocation of fragments to sites. </li></ul><ul><li>(b) Relation fragments at site 3 corresponding to department 4. </li></ul>Data Fragmentation, Replication
  19. 20. <ul><li>FIGURE 25.4 </li></ul><ul><li>Complete and disjoint fragments of the WORKS_ON relation. </li></ul><ul><li>Fragments of WORKS_ON for employees working in department 5 (C=[ESSN IN (SELECT SSN FROM EMPLOYEE WHERE DNO=5)]). </li></ul>Data Fragmentation, Replication
  20. 21. <ul><li>FIGURE 25.4 (continued) </li></ul><ul><li>Complete and disjoint fragments of the WORKS_ON relation. </li></ul><ul><li>(b) Fragments of WORKS_ON for employees working in </li></ul><ul><li>department 4 (C=[ESSN IN (SELECT SSN FROM EMPLOYEE WHERE DNO=4)]). </li></ul>Data Fragmentation, Replication
  21. 22. <ul><li>FIGURE 25.4 (continued) </li></ul><ul><li>Complete and disjoint fragments of the WORKS_ON relation. </li></ul><ul><li>Fragments of WORKS_ON for employees working in department 1 (C=[ESSN IN (SELECT SSN FROM EMPLOYEE WHERE DNO=1)]). </li></ul>Data Fragmentation, Replication
  22. 23. <ul><li>The degree of homogeneity of the DDBMS: </li></ul><ul><ul><li>Homogeneous DDBMS: all servers (or individual local DBMSs) use identical software and all users (clients) use identical software. </li></ul></ul><ul><ul><li>Heterogeneous DDBMS: servers and/or users may use different software. </li></ul></ul><ul><li>The degree of local autonomy of the DDBMS: </li></ul><ul><ul><li>If there is no provision for the local site to function as a stand-alone DBMS, then the system has no local autonomy; otherwise(e.g., direct access by local transactions to a server is permitted), the system has some degree of local autonomy. </li></ul></ul>Types of Distributed Database Systems
  23. 24. <ul><li>In a federated DDBMS , each server is an independent and autonomous centralized DBMS that has its own local users, local transactions, and DBA (i.e., a very high level of local autonomy). </li></ul><ul><li>In a federated database system (FDBS) there is some global view or schema of a federation of databases that is shared by the applications. </li></ul><ul><li>In a multidatabase system there exists no global schema. It interactively constructs one as needed by the application. </li></ul>Types of Distributed Database Systems
  24. 25. <ul><li>The type of heterogeneity present in FDBSs may arise from: </li></ul><ul><ul><li>Difference in Data Models: e.g., one server may be a relational DBMS, another an object or hierarchical SBMS. </li></ul></ul><ul><ul><li>Differences in Constraints: e.g., using the referential integrity constraints and triggers. </li></ul></ul><ul><ul><li>Differences in Query Languages: e.g., SQL has multiple versions like SQL-89, SQL-92, and SQL-99 (even with the same data model and language). </li></ul></ul>Types of Distributed Database Systems
  25. 26. <ul><li>Communication autonomy refers to the ability to decide whether to communicate with another component DBS. </li></ul><ul><li>Execution autonomy refers to the ability of a component DBS to execute local operations without inference from external operations by other component DBSs (and decide the order). </li></ul><ul><li>Association autonomy refers to the ability to decide whether and how much to share its functionality and resources with other component DBSs. </li></ul>Types of Distributed Database Systems
  26. 27. <ul><li>FIGURE 25.5 </li></ul><ul><li>The five-level schema </li></ul><ul><li>architecture in a </li></ul><ul><li>federated database </li></ul><ul><li>system (FDBS). </li></ul><ul><li>Source: Adapted from </li></ul><ul><li>Sheth and Larson, </li></ul><ul><li>Federated Database </li></ul><ul><li>Systems for Managing </li></ul><ul><li>Distributed Heterogeneous </li></ul><ul><li>Autonomous Databases . </li></ul><ul><li>ACM Computing Surveys </li></ul><ul><li>(Vol. 22: No. 3, </li></ul><ul><li>September 1990). </li></ul>Types of Distributed Database Systems
  27. 28. <ul><li>Suppose that the EMPLOYEE and the DEPARTMENT relations are distributed. The query: </li></ul><ul><li>π FNAME, LNAME, DNAME (EMPLOYEE ⋈ DNO=DNUMBER DEPARTMENT) </li></ul><ul><li>may be executed within one of the following strategies: </li></ul><ul><ul><li>Transfer both the EMPLOYEE and the DEPARTMENT relations to the result site, </li></ul></ul><ul><ul><li>Transfer the EMPLOYEE relation to site A (where the DEPARTMENT relation is located), execute the query and send the output to the result site, </li></ul></ul><ul><ul><li>Transfer the DEPARTMENT relation to site B (where the EMPLOYEE relation is located), execute the query and send the output to the result site. </li></ul></ul>Query Processing in Distributed Databases
  28. 29. <ul><li>FIGURE 25.6 </li></ul><ul><li>Examples to illustrate volume of data transferred. </li></ul>Query Processing in Distributed Databases
  29. 30. <ul><li>A DDBMS that supports full distribution, fragmentation, and replication transparence allows a query the query decomposition module to break up or decompose a query into subqueries that can be executed at the individual sites. </li></ul><ul><li>For horizontal fragmentation, a selection condition (called a guard ) specifies which tuples exist in the fragment. </li></ul><ul><li>For vertical fragmentation, the attribute list for each fragment is kept in the catalog. </li></ul>Query Processing in Distributed Databases
  30. 31. <ul><li>FIGURE 25.7 </li></ul><ul><li>Guard conditions and attributes lists for fragments. </li></ul><ul><li>Site 2 fragments. </li></ul>Query Processing in Distributed Databases
  31. 32. <ul><li>FIGURE 25.7 (continued) </li></ul><ul><li>Guard conditions and attributes lists for fragments. </li></ul><ul><li>Site 3 fragments. </li></ul>Query Processing in Distributed Databases
  32. 33. <ul><li>Concurrency control and recovery problems in DDBMS environment that are not encountered in a centralized DBMS environment. </li></ul><ul><ul><li>Dealing with multiple copies of the data items </li></ul></ul><ul><ul><li>Failure of individual sites, </li></ul></ul><ul><ul><li>Failure of communication links, </li></ul></ul><ul><ul><li>Distributed commit, </li></ul></ul><ul><ul><li>Distributed deadlock. </li></ul></ul>Overview of Concurrency Control and recovery
  33. 34. <ul><li>The distributed concurrency control based on a distinguished copy uses a particular copy of each data item. The lock for this data item are associated with the distinguished copy, and all locking and unlocking requests are sent to the site that contains that copy. </li></ul><ul><li>If all distinguished copies are kept in a single site then it is called the primary site technique, otherwise it is called the primary copy technique. </li></ul><ul><li>A site that includes a distinguished copy of a data item acts as the coordinator site for concurrency control on that item. </li></ul>Overview of Concurrency Control and recovery
  34. 35. <ul><li>The Oracle system is divided into two parts: </li></ul><ul><ul><li>A front-end as the client portion, that interacts with the user. The client has no data access responsibility and merely handles the requesting, processing, and presentation of data managed by the server. </li></ul></ul><ul><ul><li>A back-end as the server portion, that runs Oracle and handles the functions related to concurrent shared access. </li></ul></ul><ul><li>Oracle uses a two-phase commit protocol to deal with concurrent distributed transactions </li></ul>Distributed Databases in Oracle
  35. 36. <ul><li>All Oracle databases in a DDBS use Oracle’s networking software net8, which allows databases to communicate across networks to support remote and distributed transactions. </li></ul><ul><li>Oracle supports database links that define a one-way communication path from one Oracle database to another. For example, </li></ul><ul><ul><ul><li>CREATE DATABASE LINK; </li></ul></ul></ul><ul><li>establishes a connection to the sales database under the network domain US that comes under domain americas. </li></ul>Distributed Databases in Oracle
  36. 37. <ul><li>Data in an Oracle DDBS can be replicated using snapshots or replicated master tables. Replication is provided a the following levels: </li></ul><ul><ul><li>Basic replication: replicates of tables are managed for read-only access. For updates, data must be accessed at a single primary site. </li></ul></ul><ul><ul><li>Advanced (symmetric) replication: allowing applications to update table replicas throughout a replicated DDBS. Data can be read and updated at any site. </li></ul></ul>Distributed Databases in Oracle
  37. 38. <ul><li>FIGURE 25.9 </li></ul><ul><li>Oracle distributed </li></ul><ul><li>database systems. </li></ul><ul><li>Source : From </li></ul><ul><li>Oracle (1997a). </li></ul><ul><li>Copyright  Oracle </li></ul><ul><li>Corporation 1997. </li></ul><ul><li>All rights reserved. </li></ul>Distributed Databases in Oracle