Download presentation
Presentation is loading. Please wait.
Published byGwendolyn Cunningham Modified over 8 years ago
1
1 Chapter 22 Distributed DBMSs - Concepts and Design Simplified Transparencies © Pearson Education Limited 1995, 2005
2
2 Chapter 22 - Objectives u Concepts. u Advantages and disadvantages of distributed databases. u Functions and architecture for a DDBMS. u Distributed database design. u Levels of transparency. © Pearson Education Limited 1995, 2005
3
3 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. © Pearson Education Limited 1995, 2005
4
4 Concepts u Collection of logically-related shared data. u Data split into fragments. u Fragments may be replicated. u Fragments/replicas allocated to sites. u Sites linked by a communications network. u Data at each site is under control of a DBMS. u DBMSs handle local applications autonomously. u Each DBMS participates in at least one global application. © Pearson Education Limited 1995, 2005
5
5 Distributed DBMS © Pearson Education Limited 1995, 2005
6
6 Distributed Processing A centralized database that can be accessed over a computer network. © Pearson Education Limited 1995, 2005
7
7 Advantages of DDBMSs u Reflects organizational structure u Improved shareability and local autonomy u Improved availability u Improved reliability u Improved performance u Modular growth © Pearson Education Limited 1995, 2005
8
8 Disadvantages of DDBMSs u Complexity u Cost u Security u Integrity control more difficult u Lack of standards u Lack of experience u Database design more complex © Pearson Education Limited 1995, 2005
9
9 Types of DDBMS u Homogeneous DDBMS u Heterogeneous DDBMS © Pearson Education Limited 1995, 2005
10
10 Homogeneous DDBMS u All sites use same DBMS product. u Much easier to design and manage. u Approach provides incremental growth and allows increased performance. © Pearson Education Limited 1995, 2005
11
11 Heterogeneous DDBMS u Sites may run different DBMS products, with possibly different underlying data models. u Occurs when sites have implemented their own databases and integration is considered later. u Translations required to allow for: –Different hardware. –Different DBMS products. –Different hardware and different DBMS products. u Typical solution is to use gateways. © Pearson Education Limited 1995, 2005
12
12 Functions of a DBMS u Data Storage, Retrieval, and Update. u A User-Accessible Catalog. u Transaction Support. u Concurrency Control Services. u Recovery Services. © Pearson Education Limited 1995, 2005
13
13 Functions of a DBMS u Authorization Services. u Support for Data Communication. u Integrity Services. u Services to Promote Data Independence. u Utility Services. © Pearson Education Limited 1995, 2005
14
14 Functions of a DDBMS u Expect DDBMS to have at least the functionality of a DBMS. u Also to have the following functionality: –Extended communication services. –Extended Data Dictionary. –Distributed query processing. –Extended concurrency control. –Extended recovery services. © Pearson Education Limited 1995, 2005
15
15 Components of a DBMS © Pearson Education Limited 1995, 2005
16
16 Components of Database Manager (DM) © Pearson Education Limited 1995, 2005
17
17 Components of a DDBMS © Pearson Education Limited 1995, 2005
18
18 Distributed Database Design u Three key issues: –Fragmentation, –Allocation, –Replication. © Pearson Education Limited 1995, 2005
19
19 Distributed Database Design Fragmentation Relation may be divided into a number of sub- relations, which are then distributed. Allocation Each fragment is stored at site with “optimal” distribution. Replication Copy of fragment may be maintained at several sites. © Pearson Education Limited 1995, 2005
20
20 Data Allocation u Four alternative strategies regarding placement of data: –Centralized, –Partitioned (or Fragmented), –Complete Replication, –Selective Replication. © Pearson Education Limited 1995, 2005
21
21 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. © Pearson Education Limited 1995, 2005
22
22 Why Fragment? u Usage –Applications work with views rather than entire relations. u Efficiency –Data is stored close to where it is most frequently used. –Data that is not needed by local applications is not stored. © Pearson Education Limited 1995, 2005
23
23 Why Fragment? u Parallelism –With fragments as unit of distribution, transaction can be divided into several sub- queries that operate on fragments. u Security –Data not required by local applications is not stored and so not available to unauthorized users. © Pearson Education Limited 1995, 2005
24
24 Why Fragment? u Disadvantages –Performance, –Integrity. © Pearson Education Limited 1995, 2005
25
25 Correctness of Fragmentation u Three correctness rules: –Completeness, –Reconstruction, –Disjointness. © Pearson Education Limited 1995, 2005
26
26 Correctness of Fragmentation Completeness If relation R is decomposed into fragments R 1, R 2,... R n, each data item that can be found in R must appear in at least one fragment. Reconstruction u Must be possible to define a relational operation that will reconstruct R from the fragments. u Reconstruction for horizontal fragmentation is Union operation and Join for vertical. © Pearson Education Limited 1995, 2005
27
27 Correctness of Fragmentation Disjointness u If data item d i appears in fragment R i, then it should not appear in any other fragment. u Exception: vertical fragmentation, where primary key attributes must be repeated to allow reconstruction. u For horizontal fragmentation, data item is a tuple. u For vertical fragmentation, data item is an attribute. © Pearson Education Limited 1995, 2005
28
28 Types of Fragmentation u Four types of fragmentation: –Horizontal, –Vertical, –Mixed, –Derived. u Other possibility is no fragmentation: –If relation is small and not updated frequently, may be better not to fragment relation. © Pearson Education Limited 1995, 2005
29
29 Horizontal and Vertical Fragmentation © Pearson Education Limited 1995, 2005
30
30 Mixed Fragmentation © Pearson Education Limited 1995, 2005
31
31 Horizontal Fragmentation u Consists of a subset of the tuples of a relation. u Defined using Selection operation of relational algebra: p (R) u For example: P 1 = type=‘House’ (PropertyForRent) P 2 = type=‘Flat’ (PropertyForRent) © Pearson Education Limited 1995, 2005
32
32 Vertical Fragmentation u Consists of a subset of attributes of a relation. u Defined using Projection operation of relational algebra: a1,...,an (R) u For example: S 1 = staffNo, position, sex, DOB, salary (Staff) S 2 = staffNo, fName, lName, branchNo (Staff) © Pearson Education Limited 1995, 2005
33
33 Mixed Fragmentation u Consists of a horizontal fragment that is vertically fragmented, or a vertical fragment that is horizontally fragmented. u Defined using Selection and Projection operations of relational algebra: p ( a1,...,an (R)) or a1,...,an (σ p (R)) © Pearson Education Limited 1995, 2005
34
34 Example - Mixed Fragmentation S 1 = staffNo, position, sex, DOB, salary (Staff) S 2 = staffNo, fName, lName, branchNo (Staff) S 21 = branchNo=‘B003’ (S 2 ) S 22 = branchNo=‘B005’ (S 2 ) S 23 = branchNo=‘B007’ (S 2 ) © Pearson Education Limited 1995, 2005
35
35 Derived Horizontal Fragmentation u A horizontal fragment that is based on horizontal fragmentation of a parent relation. u Ensures that fragments that are frequently joined together are at same site. u Defined using Semi-Join operation of relational algebra: R i = R F S i,1 i w © Pearson Education Limited 1995, 2005
36
36 Example - Derived Horizontal Fragmentation S 3 = branchNo=‘B003’ (Staff) S 4 = branchNo=‘B005’ (Staff) S 5 = branchNo=‘B007’ (Staff) Could use derived fragmentation for Property: P i = PropertyForRent branchNo S i,3 i 5 © Pearson Education Limited 1995, 2005
37
37 Derived Horizontal Fragmentation u If relation contains more than one foreign key, need to select one as parent. u Choice can be based on fragmentation used most frequently or fragmentation with better join characteristics. © Pearson Education Limited 1995, 2005
38
38 Transparencies in a DDBMS u Distribution Transparency –Fragmentation Transparency –Location Transparency –Replication Transparency –Local Mapping Transparency –Naming Transparency © Pearson Education Limited 1995, 2005
39
39 Transparencies in a DDBMS u Transaction Transparency –Concurrency Transparency –Failure Transparency u Performance Transparency u DBMS Transparency © Pearson Education Limited 1995, 2005
40
40 Distribution Transparency u Distribution transparency allows user to perceive database as single, logical entity. u 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. u With replication transparency, user is unaware of replication of fragments. © Pearson Education Limited 1995, 2005
41
41 Naming Transparency u Each item in a DDB must have a unique name. u DDBMS must ensure that no two sites create a database object with same name. u One solution is to create central name server. u Alternative solution: prefix object with identifier of site that created it. © Pearson Education Limited 1995, 2005
42
42 Transaction Transparency u Ensures that all distributed transactions maintain distributed database’s integrity and consistency. u Distributed transaction accesses data stored at more than one location. u Each transaction is divided into number of sub- transactions, one for each site that has to be accessed. u DDBMS must ensure the indivisibility of both the global transaction and each of the sub-transactions. © Pearson Education Limited 1995, 2005
43
43 Example - Distributed Transaction u T prints out names of all staff. Define three sub- transactions T S3, T S5, and T S7 to represent agents at sites 3, 5, and 7. © Pearson Education Limited 1995, 2005
44
44 Concurrency Transparency u All transactions must execute independently and be logically consistent with results obtained if transactions executed one at a time, in some arbitrary serial order. u Same fundamental principles as for centralized DBMS. u DDBMS must ensure both global and local transactions do not interfere with each other. u Similarly, DDBMS must ensure consistency of all sub-transactions of global transaction. © Pearson Education Limited 1995, 2005
45
45 Concurrency Transparency u Replication makes concurrency more complex. u If a copy of a replicated data item is updated, update must be propagated to all copies. u Could propagate changes as part of original transaction, making it an atomic operation. u However, if one site holding copy is not reachable, then transaction is delayed until site is reachable. © Pearson Education Limited 1995, 2005
46
46 Concurrency Transparency u Could limit update propagation to only those sites currently available. Remaining sites updated when they become available again. u 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. © Pearson Education Limited 1995, 2005
47
47 Failure Transparency u DDBMS must ensure atomicity and durability of global transaction. u Means ensuring that sub-transactions of global transaction either all commit or all abort. u Thus, DDBMS must synchronize global transaction to ensure that all sub-transactions have completed successfully before recording a final COMMIT for global transaction. u Must do this in presence of site and network failures. © Pearson Education Limited 1995, 2005
48
48 Performance Transparency u 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. © Pearson Education Limited 1995, 2005
49
49 Performance Transparency u Distributed Query Processor (DQP) maps data request into ordered sequence of operations on local databases. u Must consider fragmentation, replication, and allocation schemas. u DQP has to decide: –which fragment to access; –which copy of a fragment to use; –which location to use. © Pearson Education Limited 1995, 2005
50
50 Performance Transparency u DQP produces execution strategy optimized with respect to some cost function. u Typically, costs associated with a distributed request include: –I/O cost; –CPU cost; –communication cost. © Pearson Education Limited 1995, 2005
51
51 Classification of Transactions u In IBM’s Distributed Relational Database Architecture (DRDA), four types of transactions: –Remote request –Remote unit of work –Distributed unit of work –Distributed request. © Pearson Education Limited 1995, 2005
52
52 Classification of Transactions © Pearson Education Limited 1995, 2005
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.