Documente Academic
Documente Profesional
Documente Cultură
Chapter 24 - Objectives
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 (t tr). Each DBMS participates in at least one global application. 4
Cau hoi hinh nay the hien cai gi.chon distributed DBMS
Distributed DBMS
5
Pearson Education 2009
Distributed Processing
6
Pearson Education 2009
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, Shared disk, Shared nothing.
Parallel DBMS
Advantages of DDBMSs
Reflects organizational structure Improved shareability and local autonomy Improved availability Improved reliability Improved performance Economics Modular growth
10
Disadvantages of DDBMSs
Complexity Cost Security Integrity control more difficult Lack of standards Lack of experience Database design more complex
11
Types of DDBMS
Homogeneous DDBMS (dong nhat) Heterogeneous DDBMS
12
Homogeneous DDBMS
All sites use same DBMS product. Much easier to design and manage. Approach provides incremental growth and allows increased performance.
13
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
DBMS
14
Open Group formed a Working Group to provide specifications that will create a database infrastructure environment where there is:
Common SQL API that allows client applications to be written that do not need to know vendor of DBMS they are accessing. Common database protocol that enables DBMS from one vendor to communicate directly with DBMS from another vendor without the need for a gateway. A common network protocol that allows communications between different DBMSs.
Pearson Education 2009
15
16
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. Unfederated MDBS (no local users) and federated MDBS.
17
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.
Pearson Education 2009
18
Overview of Networking
19
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.
20
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). Fragmentation schema and allocation schema. Set of schemas for each local DBMS conforming to 3level ANSI/SPARC.
Some
21
22
Pearson Education 2009
Components of a DDBMS
23
24
25
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.
26
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.
Pearson Education 2009
27
Data Allocation
Four alternative strategies regarding placement of data: Centralized, Partitioned (or Fragmented), Complete Replication, Selective Replication.
28
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 2009
29
30
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.
31
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.
32
Why Fragment?
33
Correctness of Fragmentation
34
Types of Fragmentation
Four
types of fragmentation:
Other
If relation is small and not updated frequently, may be better not to fragment relation.
Pearson Education 2009
35
36
Mixed Fragmentation
37
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)
38
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.
Pearson Education 2009
39
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
40
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)) a1, ... ,an(p(R)) or
41
42
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,
1iw
43
Si,
3i5
44
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.
45
2.
3.
4. 5.
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.
Pearson Education 2009
46
Transparencies in a DDBMS
Distribution Transparency Fragmentation Transparency Location Transparency Replication Transparency Local Mapping Transparency Naming Transparency
47
Transparencies in a DDBMS
DBMS Transparency
48
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.
49
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.
50
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.
51
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.
52
Transaction Transparency
Ensures that all distributed transactions maintain distributed databases 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.
53
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.
54
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.
Pearson Education 2009
55
Classification of Transactions
In
IBMs Distributed Relational Database Architecture (DRDA), four types of transactions: Remote request Remote unit of work Distributed unit of work Distributed request.
56
Classification of Transactions
57
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.
58
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.
59
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.
60
Performance Transparency
DDBMS
DBMS. DDBMS should not suffer any performance degradation due to distributed architecture. DDBMS should determine most cost-effective strategy to execute a request.
61
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.
62
Performance Transparency
DQP produces execution strategy optimized with respect to some cost function. Typically, costs associated with a distributed request include:
63
65
66
1. 2. 3. 4. 5. 6.
67
Last
68