Professional Documents
Culture Documents
Distributed DBMS
Distributed DBMS
SUSHIL
KULKARNI
DDBMS Concepts Applications Characteristics, Properties of DDBMS Distributed Processing Advantages & Disadvantages DDBMS Types & Functions of DDBMS Main Issues of DDBMS Component Architecture for DDBMS Data Allocation & Fragmentation Transparencies
CONCEPTS
CONCEPTS
So far, we assume a centralized database
Data are stored in one location (e.g. a single hard disk) A centralized database management system to handle transaction To handle multiple requests, a client-server system is used
- Client send requests for data to server - Server handle query, transaction management etc.
SUSHIL KULKARNI
CONCEPTS
This is not the only possibility In many cases, it may be advantageous for data to be distributed
Branches of a bank Different part of the government storing different kind of data about a person Different organizations sharing part of their data
SUSHIL KULKARNI
CONCEPTS
Data spread over multiple machines (also referred to as sites or nodes. Network interconnects the machines Data shared by users on multiple machines
SUSHIL KULKARNI
CONCEPTS
Distributed database
Logical interrelated collection of shared data, along with description of data, physically distributed over a computer network.
SUSHIL KULKARNI
CONCEPTS
Distributed DBMS
The software system that permits the management of the distributed database and makes the distribution transparent to users
SUSHIL KULKARNI
CONCEPTS
Applications
User access distributed database via applications
SUSHIL KULKARNI
CONCEPTS
TWO types of Applications
Local application : Application that do not required data from other sites. Global application : Application that required data from other sites.
SUSHIL KULKARNI
TYPES OF DDBMS
In a homogeneous distributed database: All sites have identical software. Are aware of each other and agree to cooperate in processing user requests. Each site surrenders part of its autonomy in terms of right to change schemas or software. Appears to user as a single system.
SUSHIL KULKARNI
TYPES OF DDBMS
In a heterogeneous distributed database:
Different sites may use different schemas and software. Difference in schema is a major problem for query processing. Difference in software is a major problem for transaction processing. Sites may not be aware of each other and may provide only limited facilities for cooperation in transaction processing.
SUSHIL KULKARNI
Identical DBMSs
SUSHIL KULKARNI
Non-identical DBMSs
SUSHIL KULKARNI
Local Autonomy
Local site can operate with its database when network connections fail Each site controls its own data, security, logging, recovery
SUSHIL KULKARNI
Disadvantages
Software cost & complexity Processing overhead Data integrity Slow response
DISTRIBUTED PROCESSING
SUSHIL KULKARNI
DISTRIBUTED PROCESSING
T T COM 1 T T T COM 2 T
Communication Network
DB
T COM 3
SUSHIL KULKARNI
FUNCTIONS OF DDBMS
Functions of a centralized DBMS plus:
extended communication to allow the transfer of queries and data among sites
extended system catalog to store data distribution details distributed query processing , including query optimization
SUSHIL KULKARNI
FUNCTIONS OF DDBMS
extended concurrency control to maintain consistency of replicated data.
extended recovery services to take account of failures of individual sites and common links
SUSHIL KULKARNI
Logical database is partitioned in to different data streams and located at different sites.
SUSHIL KULKARNI
DATA ALLOCATION
DATA ALLOCATION
Centralized Fragmented Complete replication
Selective replication
SUSHIL KULKARNI
Fragmentation:
Relation is partitioned into several fragments stored in distinct sites
Data Replication
A relation or fragment of a relation is replicated if it is stored redundantly in two or more sites. Full replication of a relation is the case where the relation is stored at all sites. Fully redundant databases are those in which every site contains a copy of the entire database.
SUSHIL KULKARNI
SUSHIL KULKARNI
Data Fragmentation
Division of relation r into fragments r1, r2, , rn which contain sufficient information to reconstruct relation r. Horizontal fragmentation: each tuple of r is assigned to one or more fragments. Vertical fragmentation: the schema for relation r is split into several smaller schemas.
All schemas must contain a common candidate key (or superkey) to ensure lossless join property. A special attribute, the tuple-id attribute may be added to each schema to serve as a candidate key.
Example : relation account with following schema. Account-schema = (branch-name, account-number, balance).
HORIZONTAL FRAGMENTATION
Original relation
A1
T1 T2 T3 . .T60
A1
T1
A2
An
A2
An
1 1 1 2 2
T2 T3 . .T60
Site 1
T61
. . Tn
A1
T61 . . Tn
A2
An
3
3 3
Site 2
How to reconstruct
R= Rs1 Rs2
Rsn
VERTICAL FRAGMENTATION
A1
Original Relation TID Tuple ID Hidden Attribute to ensure account and simple join reconstruction
A1
A2
A3
A4
How to Reconstruct: R=Rs1 Rs2 Rsn
(R)
t1 t2
tn
A2
TID 1 2 n
TID 1 2 n
A3
A4
t1 t2
RS2
RS1.TID=RS2.TID tn Join condition
RS1
t1 t2
tn
SITE1
SITE2
VERTICAL FRAGMENTATION
A1
Original Relation TID Tuple ID Hidden Attribute to ensure account and simple join reconstruction
A1
A2
A3
A4
How to Reconstruct: R=Rs1 Rs2 Rsn
(R)
t1 t2
tn
A2
TID 1 2 n
TID 1 2 n
A3
A4
t1 t2
RS2
RS1.TID=RS2.TID tn Join condition
RS1
t1 t2
tn
SITE1
SITE2
MIXED FRAGMENTATION
Rs1
A1 A2 A3
Rs3 R
A1 A2 A3 A4 A5
A4
A5
u s a
Rs2
A1 A2 A3 A4 (Salary Attributes) (Benefit Attributes) A5
Rs4
E u r o p e
MIXED FRAGMENTATION
A1
Original Relation TID Tuple ID Hidden Attribute to ensure account and simple join reconstruction
A1
A2
A3
A4
How to Reconstruct: R=Rs1 Rs2 Rsn
(R)
t1 t2
tn
A2
TID 1 2 n
TID 1 2 n
A3
A4
t1 t2
RS2
RS1.TID=RS2.TID tn Join condition
RS1
t1 t2
tn
SITE1
SITE2
account1=branch-name=Hillside(account) branch-name Valleyview Valleyview Valleyview Valleyview account-number A-177 A-402 A-408 A-639 balance 205 10000 1123 750
account2=branch-name=Valleyview(account)
SUSHIL KULKARNI
500 A-305 1 336 A-226 2 205 A-177 3 10000 A-402 4 62 A-155 5 1123 A-408 6 750 A-639 7 deposit2=account-number, balance, tuple-id(employee-info)
Advantages of Fragmentation
Horizontal:
allows parallel processing on fragments of a relation allows a relation to be split so that tuples are located where they are most frequently accessed
Vertical:
allows tuples to be split so that each part of the tuple is stored where it is most frequently accessed tuple-id attribute allows efficient joining of vertical fragments allows parallel processing on a relation
SUSHIL KULKARNI
A1 A2 A3 A4
A2 A3 A4 A5
TRANSPARENCIES
TRANSPARENCIES IN DDBMS
Transparencies hide implementation details from the user Example in Centralized databases : Data independence Main types of transparencies in DDBMS: o Distributed Transparency
o Transaction Transparency
SUSHIL KULKARNI
DISTRIBUTED TRANSPARENCY
Allows the user to see the database as a single, logical entity. If this transparency is exhibited then the user does not need to know that 1. The data are partitioned. 2. Data can be replicated at several sites. 3. Data location.
SUSHIL KULKARNI
EXAMPLE
Staff (staffNo, position, sex, dob, salary, fName, lName, branchNo) Vertical fragmentation:
S staffNo, position, sex , dob, salary (Staff) 1 S staffNo, fName, lName , dbranchNo (Staff) 2
SUSHIL KULKARNI
EXAMPLE
Fragment S 2 according to branch number. Assume that there are only three branches. Horizontal fragmentation:
S S S 21 22 23 branchNo ' B003 ' branchNo ' B005 ' branchNo ' B007 ' (Staff)
(Staff) (Staff)
SUSHIL KULKARNI
EXAMPLE
Assume that : S 1 and S 2 are at site 5, S 21 at site 3 S 22 at site 5 S 23 at site 7
SUSHIL KULKARNI
FRAGMENTATION TRANSPARENCY
If it is provided then the user does not need to know the data is fragmented. Example: SELECT fName, lName FROM Staff WHERE position = Manager
SUSHIL KULKARNI
LOCATION TRANSPARENCY
If it is provided then the user must know how the data has been fragmented but still does not have know the location of the data.
SUSHIL KULKARNI
LOCATION TRANSPARENCY
Example:
SELECT fName, lName FROM S21 WHERE staffNo IN (SELECT staffNO FROM S1 where position = Manager ) UNION SELECT fName, lName FROM S22 WHERE staffNo IN (SELECT staffNO FROM S1 where position = Manager )
SUSHIL KULKARNI
LOCATION TRANSPARENCY
Example:
UNION SELECT fName, lName FROM S23 WHERE staffNo IN (SELECT staffNO FROM S1 where position = Manager )
SUSHIL KULKARNI
If it is provided then the user must know how the data has been fragmented as well as the location of the data.
SUSHIL KULKARNI
LOCATION TRANSPARENCY
Example:
SELECT fName, lName FROM S21 AT SITE 3 WHERE staffNo IN (SELECT staffNO FROM S1 AT SITE 5 where position = Manager ) UNION SELECT fName, lName FROM S22 AT SITE 5 WHERE staffNo IN (SELECT staffNO FROM S1 AT SITE 3 where position = Manager )
SUSHIL KULKARNI
LOCATION TRANSPARENCY
Example:
UNION SELECT fName, lName FROM S23 AT SITE 7 WHERE staffNo IN (SELECT staffNO FROM S1 AT SITE 3 where position = Manager )
SUSHIL KULKARNI
TRANSACTION TRANSPARENCY
SUSHIL KULKARNI
LName(salary>40,000(Employee))
Site 1
(A
B)
C
Parallel Processing
(B
C)
(xx(A))
(B
C)
Department)
Site 2
100 records, 3000 bytes
Site 1
10,000 records, 1,000,000 bytes
Mg rssn to ssn
Strategies:
1)Ship both relations to the result site and join there 2)Ship employee to 2, join at 2, results to 3 3)Ship Department to 1, join at 1, results to 3
1,003,000 bytes transfered 1,002,000 bytes transfered 5,000 bytes transfered
THANKS !