SlideShare uma empresa Scribd logo
1 de 66
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/1
Outline
ā€¢ Introduction
ā€¢ Background
ā€¢ Distributed Database Design
āž” Fragmentation
āž” Data distribution
ā€¢ Database Integration
ā€¢ Semantic Data Control
ā€¢ Distributed Query Processing
ā€¢ Multidatabase Query Processing
ā€¢ Distributed Transaction Management
ā€¢ Data Replication
ā€¢ Parallel Database Systems
ā€¢ Distributed Object DBMS
ā€¢ Peer-to-Peer Data Management
ā€¢ Web Data Management
ā€¢ Current Issues
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/2
Design Problem
ā€¢ In the general setting :
Making decisions about the placement of data and programs across the sites of
a computer network as well as possibly designing the network itself.
ā€¢ In Distributed DBMS, the placement of applications entails
āž” placement of the distributed DBMS software; and
āž” placement of the applications that run on the database
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/3
Dimensions of the Problem
Level of sharing
Level of knowledge
Access pattern behavior
partial
information
dynamic
static
data
data +
program
complete
information
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/4
Distribution Design
ā€¢ Top-down
āž” mostly in designing systems from scratch
āž” mostly in homogeneous systems
ā€¢ Bottom-up
āž” when the databases already exist at a number of sites
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/5
Top-Down Design
User Input
View Integration
User Input
Requirements
Analysis
Objectives
Conceptual
Design
View Design
Access
Information ESā€™sGCS
Distribution
Design
Physical
Design
LCSā€™s
LISā€™s
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/6
Distribution Design Issues
ļ‚ŒWhy fragment at all?
ļ‚How to fragment?
ļ‚ŽHow much to fragment?
ļ‚How to test correctness?
ļ‚How to allocate?
ļ‚‘Information requirements?
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/7
Fragmentation
ā€¢ Can't we just distribute relations?
ā€¢ What is a reasonable unit of distribution?
āž” relation
āœ¦ views are subsets of relations ļƒØlocality
āœ¦ extra communication
āž” fragments of relations (sub-relations)
āœ¦ concurrent execution of a number of transactions that access different portions of
a relation
āœ¦ views that cannot be defined on a single fragment will require extra processing
āœ¦ semantic data control (especially integrity enforcement) more difficult
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/8
Fragmentation Alternatives ā€“
Horizontal
PROJ1 : projects with budgets less than
$200,000
PROJ2 : projects with budgets greater
than or equal to $200,000
PROJ1
PNO PNAME BUDGET LOC
P3 CAD/CAM 250000 New York
P4 Maintenance 310000 Paris
P5 CAD/CAM 500000 Boston
PNO PNAME LOC
P1 Instrumentation 150000 Montreal
P2 Database Develop. 135000 New York
BUDGET
PROJ2
New York
New York
PROJ
PNO PNAME BUDGET LOC
P1 Instrumentation 150000 Montreal
P3 CAD/CAM 250000
P2 Database Develop. 135000
P4 Maintenance 310000 Paris
P5 CAD/CAM 500000 Boston
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/9
Fragmentation Alternatives ā€“
Vertical
PROJ1: information about project
budgets
PROJ2: information about project
names and locations
PNO BUDGET
P1 150000
P3 250000
P2 135000
P4 310000
P5 500000
PNO PNAME LOC
P1 Instrumentation Montreal
P3 CAD/CAM New York
P2 Database Develop. New York
P4 Maintenance Paris
P5 CAD/CAM Boston
PROJ1 PROJ2
New York
New York
PROJ
PNO PNAME BUDGET LOC
P1 Instrumentation 150000 Montreal
P3 CAD/CAM 250000
P2 Database Develop. 135000
P4 Maintenance 310000 Paris
P5 CAD/CAM 500000 Boston
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/10
Degree of Fragmentation
Finding the suitable level of partitioning within this
range
tuples
or
attributes
relations
finite number of alternatives
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/11
Correctness of Fragmentation
ā€¢ Completeness
āž” Decomposition of relation R into fragments R1, R2, ..., Rn is complete if and
only if each data item in R can also be found in some Ri
ā€¢ Reconstruction
āž” If relation R is decomposed into fragments R1, R2, ..., Rn, then there should
exist some relational operator āˆ‡ such that
R = āˆ‡1ā‰¤iā‰¤nRi
ā€¢ Disjointness
āž” If relation R is decomposed into fragments R1, R2, ..., Rn, and data item di is in
Rj, then di should not be in any other fragment Rk (k ā‰  j ).
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/12
Allocation Alternatives
ā€¢ Non-replicated
āž” partitioned : each fragment resides at only one site
ā€¢ Replicated
āž” fully replicated : each fragment at each site
āž” partially replicated : each fragment at some of the sites
ā€¢ Rule of thumb:
If read-only queries
update queries
<< 1, replication is advantageous,
otherwise replication may cause problems
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/13
Full-replication Partial-replication Partitioning
QUERY
PROCESSING
Easy Same Difficulty
Same DifficultyDIRECTORY
MANAGEMENT
Easy or
Non-existant
CONCURRENCY
CONTROL
EasyDifficultModerate
RELIABILITY Very high High Low
REALITY
Possible
application
Realistic
Possible
application
Comparison of Replication
Alternatives
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/14
Information Requirements
ā€¢ Four categories:
āž” Database information
āž” Application information
āž” Communication network information
āž” Computer system information
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/15
Fragmentation
ā€¢ Horizontal Fragmentation (HF)
āž” Primary Horizontal Fragmentation (PHF)
āž” Derived Horizontal Fragmentation (DHF)
ā€¢ Vertical Fragmentation (VF)
ā€¢ Hybrid Fragmentation (HF)
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/16
PHF ā€“ Information Requirements
ā€¢ Database Information
āž” relationship
āž” cardinality of each relation: card(R)
TITLE, SAL
SKILL
ENO, ENAME, TITLE PNO, PNAME, BUDGET, LO
C
ENO, PNO, RESP, DUR
EMP PROJ
ASG
L1
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/17
PHF - Information Requirements
ā€¢ Application Information
āž” simple predicates : Given R[A1, A2, ā€¦, An], a simple predicate pj is
pj : Ai ĪøValue
where Īø {=,<,ā‰¤,>,ā‰„,ā‰ }, Value Di and Di is the domain of Ai.
For relation R we define Pr = {p1, p2, ā€¦,pm}
Example :
PNAME = "Maintenance"
BUDGET ā‰¤ 200000
āž” minterm predicates : Given R and Pr = {p1, p2, ā€¦,pm}
define M = {m1,m2,ā€¦,mr} as
M = { mi | mi = pj Pr pj* }, 1ā‰¤jā‰¤m, 1ā‰¤iā‰¤z
where pj* = pj or pj* = Ā¬(pj).
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/18
PHF ā€“ Information Requirements
Example
m1: PNAME="Maintenance" BUDGETā‰¤200000
m2: NOT(PNAME="Maintenance") BUDGETā‰¤200000
m3: PNAME= "Maintenance" NOT(BUDGETā‰¤200000)
m4: NOT(PNAME="Maintenance") NOT(BUDGETā‰¤200000)
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/19
PHF ā€“ Information Requirements
ā€¢ Application Information
āž” minterm selectivities: sel(mi)
āœ¦ The number of tuples of the relation that would be accessed by a user query
which is specified according to a given minterm predicate mi.
āž” access frequencies: acc(qi)
āœ¦ The frequency with which a user application qi accesses data.
āœ¦ Access frequency for a minterm predicate can also be defined.
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/20
Primary Horizontal Fragmentation
Definition :
Rj = Fj
(R), 1 ā‰¤ j ā‰¤ w
where Fj is a selection formula, which is (preferably) a minterm predicate.
Therefore,
A horizontal fragment Ri of relation R consists of all the tuples of R which
satisfy a minterm predicate mi.
ļƒŖ
Given a set of minterm predicates M, there are as many horizontal fragments
of relation R as there are minterm predicates.
Set of horizontal fragments also referred to as minterm fragments.
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/21
PHF ā€“ Algorithm
Given: A relation R, the set of simple predicates Pr
Output: The set of fragments of R = {R1, R2,ā€¦,Rw} which obey the
fragmentation rules.
Preliminaries :
āž” Pr should be complete
āž” Pr should be minimal
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/22
Completeness of Simple
Predicates
ā€¢ A set of simple predicates Pr is said to be complete if and only if the
accesses to the tuples of the minterm fragments defined on Pr requires that
two tuples of the same minterm fragment have the same probability of
being accessed by any application.
ā€¢ Example :
āž” Assume PROJ[PNO,PNAME,BUDGET,LOC] has two applications defined
on it.
āž” Find the budgets of projects at each location. (1)
āž” Find projects with budgets less than $200000. (2)
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/23
Completeness of Simple
Predicates
According to (1),
Pr={LOC=ā€œMontrealā€,LOC=ā€œNew Yorkā€,LOC=ā€œParisā€}
which is not complete with respect to (2).
Modify
Pr ={LOC=ā€œMontrealā€,LOC=ā€œNew
Yorkā€,LOC=ā€œParisā€, BUDGETā‰¤200000,BUDGET>200000}
which is complete.
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/24
Minimality of Simple Predicates
ā€¢ If a predicate influences how fragmentation is performed, (i.e., causes a
fragment f to be further fragmented into, say, fi and fj) then there should be
at least one application that accesses fi and fj differently.
ā€¢ In other words, the simple predicate should be relevant in determining a
fragmentation.
ā€¢ If all the predicates of a set Pr are relevant, then Pr is minimal.
acc(mi )
card( fi )
=
acc(mj )
card( fj )
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/25
Minimality of Simple Predicates
Example :
Pr ={LOC=ā€œMontrealā€,LOC=ā€œNew Yorkā€, LOC=ā€œParisā€,
BUDGETā‰¤200000,BUDGET>200000}
is minimal (in addition to being complete). However, if we add
PNAME = ā€œInstrumentationā€
then Pr is not minimal.
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/26
COM_MIN Algorithm
Given: a relation R and a set of simple predicates Pr
Output: a complete and minimal set of simple predicates Pr' for Pr
Rule 1: a relation or fragment is partitioned into at least two parts which
are accessed differently by at least one application.
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/27
COM_MIN Algorithm
ļ‚Œ Initialization :
āž” find a pi Pr such that pi partitions R according to Rule 1
āž” set Pr' = pi ; Pr Pr ā€“ {pi} ; F {fi}
ļ‚ Iteratively add predicates to Pr' until it is complete
āž” find a pj Pr such that pj partitions some fk defined according to minterm
predicate over Pr' according to Rule 1
āž” set Pr' = Pr' {pi}; Pr Pr ā€“ {pi}; F F {fi}
āž” if pk Pr' which is nonrelevant then
Pr' Pr ā€“ {pi}
F F ā€“ {fi}
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/28
PHORIZONTAL Algorithm
Makes use of COM_MIN to perform fragmentation.
Input: a relation R and a set of simple predicates Pr
Output: a set of minterm predicates M according to which relation R is to
be fragmented
ļ‚Œ Pr' COM_MIN (R,Pr)
ļ‚ determine the set M of minterm predicates
ļ‚Ž determine the set I of implications among pi Pr
ļ‚ eliminate the contradictory minterms from M
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/29
PHF ā€“ Example
ā€¢ Two candidate relations : PAY and PROJ.
ā€¢ Fragmentation of relation PAY
āž” Application: Check the salary info and determine raise.
āž” Employee records kept at two sites ļƒžapplication run at two sites
āž” Simple predicates
p1 : SAL ā‰¤ 30000
p2 : SAL > 30000
Pr = {p1,p2} which is complete and minimal Pr'=Pr
āž” Minterm predicates
m1 : (SAL ā‰¤ 30000)
m2 : NOT(SAL ā‰¤ 30000) (SAL > 30000)
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/30
PHF ā€“ Example
TITLE
Mech. Eng.
Programmer
SAL
27000
24000
PAY1 PAY2
TITLE
Elect. Eng.
Syst. Anal.
SAL
40000
34000
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/31
PHF ā€“ Example
ā€¢ Fragmentation of relation PROJ
āž” Applications:
āœ¦ Find the name and budget of projects given their no.
āœ“ Issued at three sites
āœ¦ Access project information according to budget
āœ“ one site accesses ā‰¤200000 other accesses >200000
āž” Simple predicates
āž” For application (1)
p1 : LOC = ā€œMontrealā€
p2 : LOC = ā€œNew Yorkā€
p3 : LOC = ā€œParisā€
āž” For application (2)
p4 : BUDGET ā‰¤ 200000
p5 : BUDGET > 200000
āž” Pr = Pr' = {p1,p2,p3,p4,p5}
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/32
ā€¢ Fragmentation of relation PROJ continued
āž” Minterm fragments left after elimination
m1 : (LOC = ā€œMontrealā€) (BUDGET ā‰¤ 200000)
m2 : (LOC = ā€œMontrealā€) (BUDGET > 200000)
m3 : (LOC = ā€œNew Yorkā€) (BUDGET ā‰¤ 200000)
m4 : (LOC = ā€œNew Yorkā€) (BUDGET > 200000)
m5 : (LOC = ā€œParisā€) (BUDGET ā‰¤ 200000)
m6 : (LOC = ā€œParisā€) (BUDGET > 200000)
PHF ā€“ Example
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/33
PHF ā€“ Example
PROJ1
PNO PNAME BUDGET LOC PNO PNAME BUDGET LOC
P1 Instrumentation 150000 Montreal P2
Database
Develop.
135000 New York
PROJ2
PROJ4 PROJ6
PNO PNAME BUDGET LOC
P3 CAD/CAM 250000 New
York
PNO PNAME BUDGET LOC
MaintenanceP4 310000 Paris
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/34
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/35
ā€¢ Completeness
āž” Since Pr' is complete and minimal, the selection predicates are complete
ā€¢ Reconstruction
āž” If relation R is fragmented into FR = {R1,R2,ā€¦,Rr}
R = Ri FR Ri
ā€¢ Disjointness
āž” Minterm predicates that form the basis of fragmentation should be mutually
exclusive.
PHF ā€“ Correctness
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/36
Derived Horizontal Fragmentation
ā€¢ Defined on a member relation of a link according to a selection operation
specified on its owner.
āž” Each link is an equijoin.
āž” Equijoin can be implemented by means of semijoins.
TITLE,SAL
SKILL
ENO, ENAME, TITLE PNO, PNAME, BUDGET, LOC
ENO, PNO, RESP, DUR
EMP PROJ
ASG
L1
L2 L3
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/37
DHF ā€“ Definition
Given a link L where owner(L)=S and member(L)=R, the derived horizontal
fragments of R are defined as
Ri = R ā‹‰F Si, 1ā‰¤iā‰¤w
where w is the maximum number of fragments that will be defined on R and
Si = Fi
(S)
where Fi is the formula according to which the primary horizontal fragment
Si is defined.
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/38
Given link L1 where owner(L1)=SKILL and member(L1)=EMP
EMP1 = EMP ā‹‰ SKILL1
EMP2 = EMP ā‹‰ SKILL2
where
SKILL1 = SALā‰¤30000(SKILL)
SKILL2 = SAL>30000(SKILL)
DHF ā€“ Example
ENO ENAME TITLE
E3 A. Lee Mech. Eng.
E4 J. Miller Programmer
E7 R. Davis Mech. Eng.
EMP1
ENO ENAME TITLE
E1 J. Doe Elect. Eng.
E2 M. Smith Syst. Anal.
E5 B. Casey Syst. Anal.
EMP2
E6 L. Chu Elect. Eng.
E8 J. Jones Syst. Anal.
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/39
DHF ā€“ Correctness
ā€¢ Completeness
āž” Referential integrity
āž” Let R be the member relation of a link whose owner is relation S which is
fragmented as FS = {S1, S2, ..., Sn}. Furthermore, let A be the join attribute
between R and S. Then, for each tuple t of R, there should be a tuple t' of S
such that
t[A] = t' [A]
ā€¢ Reconstruction
āž” Same as primary horizontal fragmentation.
ā€¢ Disjointness
āž” Simple join graphs between the owner and the member fragments.
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/40
ā€¢ Has been studied within the centralized context
āž” design methodology
āž” physical clustering
ā€¢ More difficult than horizontal, because more alternatives exist.
Two approaches :
āž” grouping
āœ¦ attributes to fragments
āž” splitting
āœ¦ relation to fragments
Vertical Fragmentation
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/41
ā€¢ Overlapping fragments
āž” grouping
ā€¢ Non-overlapping fragments
āž” splitting
We do not consider the replicated key attributes to be overlapping.
Advantage:
Easier to enforce functional dependencies
(for integrity checking etc.)
Vertical Fragmentation
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/42
VF ā€“ Information Requirements
ā€¢ Application Information
āž” Attribute affinities
āœ¦ a measure that indicates how closely related the attributes are
āœ¦ This is obtained from more primitive usage data
āž” Attribute usage values
āœ¦ Given a set of queries Q = {q1, q2,ā€¦, qq} that will run on the relation
R[A1, A2,ā€¦, An],
use(qi,ā€¢) can be defined accordingly
use(qi,Aj) =
1 if attribute Aj is referenced by query qi
0 otherwise
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/43
VF ā€“ Definition of use(qi,Aj)
Consider the following 4 queries for relation PROJ
q1:SELECT BUDGET q2: SELECT PNAME,BUDGET
FROM PROJ FROM PROJ
WHERE PNO=Value
q3:SELECT PNAME q4: SELECT SUM(BUDGET)
FROM PROJ FROM PROJ
WHERE LOC=Value WHERE LOC=Value
Let A1= PNO, A2= PNAME, A3= BUDGET, A4= LOC
q1
q2
q3
q4
A1
1 0 1 0
0 01 1
0 01 1
0 0 1 1
A2 A3 A4
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/44
VF ā€“ Affinity Measure aff(Ai,Aj)
The attribute affinity measure between two attributes Ai and Aj of a relation
R[A1, A2, ā€¦, An] with respect to the set of applications Q = (q1, q2, ā€¦, qq) is
defined as follows :
aff (Ai, Aj) (query access)
all queries that access Ai and Aj
query access access frequency of a query
access
execution
all sites
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/45
Assume each query in the previous example accesses the attributes once
during each execution.
Also assume the access frequencies
Then
aff(A1, A3) = 15*1 + 20*1+10*1
= 45
and the attribute affinity matrix AA is
VF ā€“ Calculation of aff(Ai, Aj)
4
q1
q 2
q3
q
S1
S2
S3
15 20 10
5 0 0
25 2525
3 0 0
A A A A1 2 3 4
A
A
A
A
1
2
3
4
45 0 45 0
0 80 5 75
45 5 53 3
0 75 3 78
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/46
ā€¢ Take the attribute affinity matrix AA and reorganize the attribute orders to
form clusters where the attributes in each cluster demonstrate high affinity
to one another.
ā€¢ Bond Energy Algorithm (BEA) has been used for clustering of entities.
BEA finds an ordering of entities (in our case attributes) such that the
global affinity measure is maximized.
VF ā€“ Clustering Algorithm
AM (affinity of Ai and Aj with their neighbors)
ji
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/47
Bond Energy Algorithm
Input: The AA matrix
Output: The clustered affinity matrix CA which is a perturbation of AA
ļ‚ŒInitialization: Place and fix one of the columns of AA in CA.
ļ‚Iteration: Place the remaining n-i columns in the remaining i+1 positions in
the CA matrix. For each column, choose the placement that makes the most
contribution to the global affinity measure.
ļ‚ŽRow order: Order the rows according to the column ordering.
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/48
Bond Energy Algorithm
ā€œBestā€ placement? Define contribution of a placement:
cont(Ai, Ak, Aj) = 2bond(Ai, Ak)+2bond(Ak, Al) ā€“2bond(Ai, Aj)
where
bond(Ax,Ay) = aff(Az,Ax)aff(Az,Ay)
z 1
n
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/49
BEA ā€“ Example
Consider the following AA matrix and the corresponding CA matrix where
A1 and A2 have been placed. Place A3:
Ordering (0-3-1) :
cont(A0,A3,A1) = 2bond(A0 , A3)+2bond(A3 , A1)ā€“2bond(A0 , A1)
= 2* 0 + 2* 4410 ā€“ 2*0 = 8820
Ordering (1-3-2) :
cont(A1,A3,A2) = 2bond(A1 , A3)+2bond(A3 , A2)ā€“2bond(A1,A2)
= 2* 4410 + 2* 890 ā€“ 2*225 = 10150
Ordering (2-3-4) :
cont (A2,A3,A4) = 1780
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/50
BEA ā€“ Example
ā€¢ Therefore, the CA matrix has the form
ā€¢ When A4 is placed, the final form of the CA matrix (after row organization)
is
A1 A2A3
45
0
45
0
45
5
53
3
0
80
5
75
A1 A2A3 A4
A1
A2
A3
A4
45
45
0
0
45
53
5
3
0
5
80
75
0
3
75
78
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/51
How can you divide a set of clustered attributes {A1, A2, ā€¦, An}
into two (or more) sets {A1, A2, ā€¦, Ai} and {Ai, ā€¦, An} such that
there are no (or minimal) applications that access both (or more
than one) of the sets.
VF ā€“ Algorithm
A1
A2
Ai
Ai+1
Am
ā€¦A1 A2 A3 Ai Ai+1 Am
BA
. . .
TA
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/52
Define
TQ = set of applications that access only TA
BQ = set of applications that access only BA
OQ = set of applications that access both TA and BA
and
CTQ = total number of accesses to attributes by applications
that access only TA
CBQ = total number of accesses to attributes by applications
that access only BA
COQ = total number of accesses to attributes by applications
that access both TA and BA
Then find the point along the diagonal that maximizes
VF ā€“ ALgorithm
CTQ CBQ COQ2
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/53
Two problems :
ļƒžCluster forming in the middle of the CA matrix
āž” Shift a row up and a column left and apply the algorithm to find the ā€œbestā€
partitioning point
āž” Do this for all possible shifts
āž” Cost O(m2)
ļƒžMore than two clusters
āž” m-way partitioning
āž” try 1, 2, ā€¦, mā€“1 split points along diagonal and try to find the best point for
each of these
āž” Cost O(2m)
VF ā€“ Algorithm
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/54
VF ā€“ Correctness
A relation R, defined over attribute set A and key K, generates the vertical
partitioning FR = {R1, R2, ā€¦, Rr}.
ā€¢ Completeness
āž” The following should be true for A:
A = ARi
ā€¢ Reconstruction
āž” Reconstruction can be achieved by
R = ā‹ˆā€¢K Ri, Ri FR
ā€¢ Disjointness
āž” TID's are not considered to be overlapping since they are maintained by the
system
āž” Duplicated keys are not considered to be overlapping
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/55
Hybrid Fragmentation
R
HFHF
R1
VF VFVFVFVF
R11 R12 R21 R22 R23
R2
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/56
Fragment Allocation
ā€¢ Problem Statement
Given
F = {F1, F2, ā€¦, Fn} fragments
S ={S1, S2, ā€¦, Sm} network sites
Q = {q1, q2,ā€¦, qq} applications
Find the "optimal" distribution of F to S.
ā€¢ Optimality
āž” Minimal cost
āœ¦ Communication + storage + processing (read & update)
āœ¦ Cost in terms of time (usually)
āž” Performance
Response time and/or throughput
āž” Constraints
āœ¦ Per site constraints (storage & processing)
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/57
Information Requirements
ā€¢ Database information
āž” selectivity of fragments
āž” size of a fragment
ā€¢ Application information
āž” access types and numbers
āž” access localities
ā€¢ Communication network information
āž” unit cost of storing data at a site
āž” unit cost of processing at a site
ā€¢ Computer system information
āž” bandwidth
āž” latency
āž” communication overhead
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/58
Allocation
File Allocation (FAP) vs Database Allocation (DAP):
āž” Fragments are not individual files
āœ¦ relationships have to be maintained
āž” Access to databases is more complicated
āœ¦ remote file access model not applicable
āœ¦ relationship between allocation and query processing
āž” Cost of integrity enforcement should be considered
āž” Cost of concurrency control should be considered
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/59
Allocation ā€“ Information
Requirements
ā€¢ Database Information
āž” selectivity of fragments
āž” size of a fragment
ā€¢ Application Information
āž” number of read accesses of a query to a fragment
āž” number of update accesses of query to a fragment
āž” A matrix indicating which queries updates which fragments
āž” A similar matrix for retrievals
āž” originating site of each query
ā€¢ Site Information
āž” unit cost of storing data at a site
āž” unit cost of processing at a site
ā€¢ Network Information
āž” communication cost/frame between two sites
āž” frame size
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/60
General Form
min(Total Cost)
subject to
response time constraint
storage constraint
processing constraint
Decision Variable
Allocation Model
xij
1 if fragment Fi is stored at site Sj
0 otherwise
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/61
ā€¢ Total Cost
ā€¢ Storage Cost (of fragment Fj at Sk)
ā€¢ Query Processing Cost (for one query)
processing component + transmission component
Allocation Model
(unit storage cost at Sk) (size of Fj) xjk
query processing cost
all queries
cost of storing a fragment at a site
all fragmentsall sites
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/62
Allocation Model
ā€¢ Query Processing Cost
Processing component
access cost + integrity enforcement cost + concurrency control cost
āž” Access cost
āž” Integrity enforcement and concurrency control costs
āœ¦ Can be similarly calculated
(no. of update accesses+ no. of read accesses)
all fragmentsall sites
xij local processing cost at a site
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/63
ā€¢ Query Processing Cost
Transmission component
cost of processing updates + cost of processing retrievals
āž” Cost of updates
āž” Retrieval Cost
Allocation Model
update message cost
all fragmentsall sites
acknowledgment cost
all fragmentsall sites
minall sites
all fragments
(cost of retrieval command
cost of sending back the result)
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/64
Allocation Model
ā€¢ Constraints
āž” Response Time
execution time of query ā‰¤ max. allowable response time for that query
āž” Storage Constraint (for a site)
āž” Processing constraint (for a site)
storage requirement of a fragment at that site
all fragments
storage capacity at that site
processing load of a query at that site
all queries processing capacity of that site
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/65
Allocation Model
ā€¢ Solution Methods
āž” FAP is NP-complete
āž” DAP also NP-complete
ā€¢ Heuristics based on
āž” single commodity warehouse location (for FAP)
āž” knapsack problem
āž” branch and bound techniques
āž” network flow
Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/66
Allocation Model
ā€¢ Attempts to reduce the solution space
āž” assume all candidate partitionings known; select the ā€œbestā€ partitioning
āž” ignore replication at first
āž” sliding window on fragments

Mais conteĆŗdo relacionado

Mais procurados

Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01Jotham Gadot
Ā 
Locks In Disributed Systems
Locks In Disributed SystemsLocks In Disributed Systems
Locks In Disributed Systemsmridul mishra
Ā 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Meghaj Mallick
Ā 
Lecture 1 (distributed systems)
Lecture 1 (distributed systems)Lecture 1 (distributed systems)
Lecture 1 (distributed systems)Fazli Amin
Ā 
Advanced DBMS presentation
Advanced DBMS presentationAdvanced DBMS presentation
Advanced DBMS presentationHindustan Petroleum
Ā 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)Ravinder Kamboj
Ā 
Distributed dbms architectures
Distributed dbms architecturesDistributed dbms architectures
Distributed dbms architecturesPooja Dixit
Ā 
Concurrency Control Techniques
Concurrency Control TechniquesConcurrency Control Techniques
Concurrency Control TechniquesRaj vardhan
Ā 
Query Decomposition and data localization
Query Decomposition and data localization Query Decomposition and data localization
Query Decomposition and data localization Hafiz faiz
Ā 
Distributed Database Management System
Distributed Database Management SystemDistributed Database Management System
Distributed Database Management SystemAAKANKSHA JAIN
Ā 
Lecture 10 distributed database management system
Lecture 10   distributed database management systemLecture 10   distributed database management system
Lecture 10 distributed database management systememailharmeet
Ā 
Distributed Database System
Distributed Database SystemDistributed Database System
Distributed Database SystemSulemang
Ā 
Distributed database management systems
Distributed database management systemsDistributed database management systems
Distributed database management systemsDhani Ahmad
Ā 
Database , 1 Introduction
 Database , 1 Introduction Database , 1 Introduction
Database , 1 IntroductionAli Usman
Ā 
3 Level Architecture
3 Level Architecture3 Level Architecture
3 Level ArchitectureAdeel Rasheed
Ā 

Mais procurados (20)

Distributed DBMS - Unit 3 - Distributed DBMS Architecture
Distributed DBMS - Unit 3 - Distributed DBMS ArchitectureDistributed DBMS - Unit 3 - Distributed DBMS Architecture
Distributed DBMS - Unit 3 - Distributed DBMS Architecture
Ā 
Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01
Ā 
Locks In Disributed Systems
Locks In Disributed SystemsLocks In Disributed Systems
Locks In Disributed Systems
Ā 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.
Ā 
Lecture 1 (distributed systems)
Lecture 1 (distributed systems)Lecture 1 (distributed systems)
Lecture 1 (distributed systems)
Ā 
Advanced DBMS presentation
Advanced DBMS presentationAdvanced DBMS presentation
Advanced DBMS presentation
Ā 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
Ā 
Distributed dbms architectures
Distributed dbms architecturesDistributed dbms architectures
Distributed dbms architectures
Ā 
Distributed DBMS - Unit 1 - Introduction
Distributed DBMS - Unit 1 - IntroductionDistributed DBMS - Unit 1 - Introduction
Distributed DBMS - Unit 1 - Introduction
Ā 
Concurrency Control Techniques
Concurrency Control TechniquesConcurrency Control Techniques
Concurrency Control Techniques
Ā 
Lec 7 query processing
Lec 7 query processingLec 7 query processing
Lec 7 query processing
Ā 
Distributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data ControlDistributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data Control
Ā 
Query Decomposition and data localization
Query Decomposition and data localization Query Decomposition and data localization
Query Decomposition and data localization
Ā 
Distributed Database Management System
Distributed Database Management SystemDistributed Database Management System
Distributed Database Management System
Ā 
Lecture 10 distributed database management system
Lecture 10   distributed database management systemLecture 10   distributed database management system
Lecture 10 distributed database management system
Ā 
Distributed Database System
Distributed Database SystemDistributed Database System
Distributed Database System
Ā 
Distributed database management systems
Distributed database management systemsDistributed database management systems
Distributed database management systems
Ā 
Database , 1 Introduction
 Database , 1 Introduction Database , 1 Introduction
Database , 1 Introduction
Ā 
Replication in Distributed Systems
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed Systems
Ā 
3 Level Architecture
3 Level Architecture3 Level Architecture
3 Level Architecture
Ā 

Semelhante a Database, 3 Distribution Design

Design
DesignDesign
DesignAli Raza
Ā 
Design
DesignDesign
DesignAli Raza
Ā 
Database ,2 Background
 Database ,2 Background Database ,2 Background
Database ,2 BackgroundAli Usman
Ā 
Database ,7 query localization
Database ,7 query localizationDatabase ,7 query localization
Database ,7 query localizationAli Usman
Ā 
IJSETR-VOL-3-ISSUE-12-3358-3363
IJSETR-VOL-3-ISSUE-12-3358-3363IJSETR-VOL-3-ISSUE-12-3358-3363
IJSETR-VOL-3-ISSUE-12-3358-3363SHIVA REDDY
Ā 
Performance measures
Performance measuresPerformance measures
Performance measuresDivya Tiwari
Ā 
Information-Flow Analysis of Design Breaks up
Information-Flow Analysis of Design Breaks upInformation-Flow Analysis of Design Breaks up
Information-Flow Analysis of Design Breaks upEswar Publications
Ā 
Problems in Task Scheduling in Multiprocessor System
Problems in Task Scheduling in Multiprocessor SystemProblems in Task Scheduling in Multiprocessor System
Problems in Task Scheduling in Multiprocessor Systemijtsrd
Ā 
Data structures assignmentweek4b.pdfCI583 Data Structure
Data structures assignmentweek4b.pdfCI583 Data StructureData structures assignmentweek4b.pdfCI583 Data Structure
Data structures assignmentweek4b.pdfCI583 Data StructureOllieShoresna
Ā 
1 introduction
1 introduction1 introduction
1 introductionAmrit Kaur
Ā 
P Systems and Distributed Computing
P Systems and Distributed ComputingP Systems and Distributed Computing
P Systems and Distributed ComputingApostolos Syropoulos
Ā 
DATA MINING USING R (1).pptx
DATA MINING USING R (1).pptxDATA MINING USING R (1).pptx
DATA MINING USING R (1).pptxmyworld93
Ā 
IRJET- Hadoop based Frequent Closed Item-Sets for Association Rules form ...
IRJET-  	  Hadoop based Frequent Closed Item-Sets for Association Rules form ...IRJET-  	  Hadoop based Frequent Closed Item-Sets for Association Rules form ...
IRJET- Hadoop based Frequent Closed Item-Sets for Association Rules form ...IRJET Journal
Ā 
Chapter 3 principles of parallel algorithm design
Chapter 3   principles of parallel algorithm designChapter 3   principles of parallel algorithm design
Chapter 3 principles of parallel algorithm designDenisAkbar1
Ā 
cis97003
cis97003cis97003
cis97003perfj
Ā 
1 introduction DDBS
1 introduction DDBS1 introduction DDBS
1 introduction DDBSnaimanighat
Ā 
DataRobot R Package
DataRobot R PackageDataRobot R Package
DataRobot R PackageDataRobot
Ā 

Semelhante a Database, 3 Distribution Design (20)

Design
DesignDesign
Design
Ā 
Design
DesignDesign
Design
Ā 
Database ,2 Background
 Database ,2 Background Database ,2 Background
Database ,2 Background
Ā 
Database ,7 query localization
Database ,7 query localizationDatabase ,7 query localization
Database ,7 query localization
Ā 
IJSETR-VOL-3-ISSUE-12-3358-3363
IJSETR-VOL-3-ISSUE-12-3358-3363IJSETR-VOL-3-ISSUE-12-3358-3363
IJSETR-VOL-3-ISSUE-12-3358-3363
Ā 
Performance measures
Performance measuresPerformance measures
Performance measures
Ā 
DDBMS
DDBMSDDBMS
DDBMS
Ā 
Information-Flow Analysis of Design Breaks up
Information-Flow Analysis of Design Breaks upInformation-Flow Analysis of Design Breaks up
Information-Flow Analysis of Design Breaks up
Ā 
Problems in Task Scheduling in Multiprocessor System
Problems in Task Scheduling in Multiprocessor SystemProblems in Task Scheduling in Multiprocessor System
Problems in Task Scheduling in Multiprocessor System
Ā 
User biglm
User biglmUser biglm
User biglm
Ā 
Data structures assignmentweek4b.pdfCI583 Data Structure
Data structures assignmentweek4b.pdfCI583 Data StructureData structures assignmentweek4b.pdfCI583 Data Structure
Data structures assignmentweek4b.pdfCI583 Data Structure
Ā 
1 introduction
1 introduction1 introduction
1 introduction
Ā 
P Systems and Distributed Computing
P Systems and Distributed ComputingP Systems and Distributed Computing
P Systems and Distributed Computing
Ā 
DATA MINING USING R (1).pptx
DATA MINING USING R (1).pptxDATA MINING USING R (1).pptx
DATA MINING USING R (1).pptx
Ā 
Solution(1)
Solution(1)Solution(1)
Solution(1)
Ā 
IRJET- Hadoop based Frequent Closed Item-Sets for Association Rules form ...
IRJET-  	  Hadoop based Frequent Closed Item-Sets for Association Rules form ...IRJET-  	  Hadoop based Frequent Closed Item-Sets for Association Rules form ...
IRJET- Hadoop based Frequent Closed Item-Sets for Association Rules form ...
Ā 
Chapter 3 principles of parallel algorithm design
Chapter 3   principles of parallel algorithm designChapter 3   principles of parallel algorithm design
Chapter 3 principles of parallel algorithm design
Ā 
cis97003
cis97003cis97003
cis97003
Ā 
1 introduction DDBS
1 introduction DDBS1 introduction DDBS
1 introduction DDBS
Ā 
DataRobot R Package
DataRobot R PackageDataRobot R Package
DataRobot R Package
Ā 

Mais de Ali Usman

Cisco Packet Tracer Overview
Cisco Packet Tracer OverviewCisco Packet Tracer Overview
Cisco Packet Tracer OverviewAli Usman
Ā 
Islamic Arts and Architecture
Islamic Arts and  ArchitectureIslamic Arts and  Architecture
Islamic Arts and ArchitectureAli Usman
Ā 
Database ,18 Current Issues
Database ,18 Current IssuesDatabase ,18 Current Issues
Database ,18 Current IssuesAli Usman
Ā 
Database , 17 Web
Database , 17 WebDatabase , 17 Web
Database , 17 WebAli Usman
Ā 
Database ,16 P2P
Database ,16 P2P Database ,16 P2P
Database ,16 P2P Ali Usman
Ā 
Database , 15 Object DBMS
Database , 15 Object DBMSDatabase , 15 Object DBMS
Database , 15 Object DBMSAli Usman
Ā 
Database ,14 Parallel DBMS
Database ,14 Parallel DBMSDatabase ,14 Parallel DBMS
Database ,14 Parallel DBMSAli Usman
Ā 
Database , 13 Replication
Database , 13 ReplicationDatabase , 13 Replication
Database , 13 ReplicationAli Usman
Ā 
Database , 12 Reliability
Database , 12 ReliabilityDatabase , 12 Reliability
Database , 12 ReliabilityAli Usman
Ā 
Database ,11 Concurrency Control
Database ,11 Concurrency ControlDatabase ,11 Concurrency Control
Database ,11 Concurrency ControlAli Usman
Ā 
Database ,10 Transactions
Database ,10 TransactionsDatabase ,10 Transactions
Database ,10 TransactionsAli Usman
Ā 
Database , 6 Query Introduction
Database , 6 Query Introduction Database , 6 Query Introduction
Database , 6 Query Introduction Ali Usman
Ā 
Database , 5 Semantic
Database , 5 SemanticDatabase , 5 Semantic
Database , 5 SemanticAli Usman
Ā 
Database , 4 Data Integration
Database , 4 Data IntegrationDatabase , 4 Data Integration
Database , 4 Data IntegrationAli Usman
Ā 
Processor Specifications
Processor SpecificationsProcessor Specifications
Processor SpecificationsAli Usman
Ā 
Fifty Year Of Microprocessor
Fifty Year Of MicroprocessorFifty Year Of Microprocessor
Fifty Year Of MicroprocessorAli Usman
Ā 
Discrete Structures lecture 2
 Discrete Structures lecture 2 Discrete Structures lecture 2
Discrete Structures lecture 2Ali Usman
Ā 
Discrete Structures. Lecture 1
 Discrete Structures. Lecture 1  Discrete Structures. Lecture 1
Discrete Structures. Lecture 1 Ali Usman
Ā 
Muslim Contributions in Medicine-Geography-Astronomy
Muslim Contributions in Medicine-Geography-AstronomyMuslim Contributions in Medicine-Geography-Astronomy
Muslim Contributions in Medicine-Geography-AstronomyAli Usman
Ā 
Muslim Contributions in Geography
Muslim Contributions in GeographyMuslim Contributions in Geography
Muslim Contributions in GeographyAli Usman
Ā 

Mais de Ali Usman (20)

Cisco Packet Tracer Overview
Cisco Packet Tracer OverviewCisco Packet Tracer Overview
Cisco Packet Tracer Overview
Ā 
Islamic Arts and Architecture
Islamic Arts and  ArchitectureIslamic Arts and  Architecture
Islamic Arts and Architecture
Ā 
Database ,18 Current Issues
Database ,18 Current IssuesDatabase ,18 Current Issues
Database ,18 Current Issues
Ā 
Database , 17 Web
Database , 17 WebDatabase , 17 Web
Database , 17 Web
Ā 
Database ,16 P2P
Database ,16 P2P Database ,16 P2P
Database ,16 P2P
Ā 
Database , 15 Object DBMS
Database , 15 Object DBMSDatabase , 15 Object DBMS
Database , 15 Object DBMS
Ā 
Database ,14 Parallel DBMS
Database ,14 Parallel DBMSDatabase ,14 Parallel DBMS
Database ,14 Parallel DBMS
Ā 
Database , 13 Replication
Database , 13 ReplicationDatabase , 13 Replication
Database , 13 Replication
Ā 
Database , 12 Reliability
Database , 12 ReliabilityDatabase , 12 Reliability
Database , 12 Reliability
Ā 
Database ,11 Concurrency Control
Database ,11 Concurrency ControlDatabase ,11 Concurrency Control
Database ,11 Concurrency Control
Ā 
Database ,10 Transactions
Database ,10 TransactionsDatabase ,10 Transactions
Database ,10 Transactions
Ā 
Database , 6 Query Introduction
Database , 6 Query Introduction Database , 6 Query Introduction
Database , 6 Query Introduction
Ā 
Database , 5 Semantic
Database , 5 SemanticDatabase , 5 Semantic
Database , 5 Semantic
Ā 
Database , 4 Data Integration
Database , 4 Data IntegrationDatabase , 4 Data Integration
Database , 4 Data Integration
Ā 
Processor Specifications
Processor SpecificationsProcessor Specifications
Processor Specifications
Ā 
Fifty Year Of Microprocessor
Fifty Year Of MicroprocessorFifty Year Of Microprocessor
Fifty Year Of Microprocessor
Ā 
Discrete Structures lecture 2
 Discrete Structures lecture 2 Discrete Structures lecture 2
Discrete Structures lecture 2
Ā 
Discrete Structures. Lecture 1
 Discrete Structures. Lecture 1  Discrete Structures. Lecture 1
Discrete Structures. Lecture 1
Ā 
Muslim Contributions in Medicine-Geography-Astronomy
Muslim Contributions in Medicine-Geography-AstronomyMuslim Contributions in Medicine-Geography-Astronomy
Muslim Contributions in Medicine-Geography-Astronomy
Ā 
Muslim Contributions in Geography
Muslim Contributions in GeographyMuslim Contributions in Geography
Muslim Contributions in Geography
Ā 

ƚltimo

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
Ā 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
Ā 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
Ā 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
Ā 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
Ā 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
Ā 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service šŸø 8923113531 šŸŽ° Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service šŸø 8923113531 šŸŽ° Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service šŸø 8923113531 šŸŽ° Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service šŸø 8923113531 šŸŽ° Avail...gurkirankumar98700
Ā 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
Ā 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
Ā 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
Ā 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
Ā 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
Ā 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
Ā 
Scaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organizationScaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organizationRadu Cotescu
Ā 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
Ā 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
Ā 
Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024The Digital Insurer
Ā 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
Ā 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
Ā 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
Ā 

ƚltimo (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
Ā 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Ā 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Ā 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Ā 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
Ā 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
Ā 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service šŸø 8923113531 šŸŽ° Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service šŸø 8923113531 šŸŽ° Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service šŸø 8923113531 šŸŽ° Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service šŸø 8923113531 šŸŽ° Avail...
Ā 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Ā 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Ā 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
Ā 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
Ā 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
Ā 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
Ā 
Scaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organizationScaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organization
Ā 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Ā 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Ā 
Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024
Ā 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Ā 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
Ā 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
Ā 

Database, 3 Distribution Design

  • 1. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/1 Outline ā€¢ Introduction ā€¢ Background ā€¢ Distributed Database Design āž” Fragmentation āž” Data distribution ā€¢ Database Integration ā€¢ Semantic Data Control ā€¢ Distributed Query Processing ā€¢ Multidatabase Query Processing ā€¢ Distributed Transaction Management ā€¢ Data Replication ā€¢ Parallel Database Systems ā€¢ Distributed Object DBMS ā€¢ Peer-to-Peer Data Management ā€¢ Web Data Management ā€¢ Current Issues
  • 2. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/2 Design Problem ā€¢ In the general setting : Making decisions about the placement of data and programs across the sites of a computer network as well as possibly designing the network itself. ā€¢ In Distributed DBMS, the placement of applications entails āž” placement of the distributed DBMS software; and āž” placement of the applications that run on the database
  • 3. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/3 Dimensions of the Problem Level of sharing Level of knowledge Access pattern behavior partial information dynamic static data data + program complete information
  • 4. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/4 Distribution Design ā€¢ Top-down āž” mostly in designing systems from scratch āž” mostly in homogeneous systems ā€¢ Bottom-up āž” when the databases already exist at a number of sites
  • 5. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/5 Top-Down Design User Input View Integration User Input Requirements Analysis Objectives Conceptual Design View Design Access Information ESā€™sGCS Distribution Design Physical Design LCSā€™s LISā€™s
  • 6. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/6 Distribution Design Issues ļ‚ŒWhy fragment at all? ļ‚How to fragment? ļ‚ŽHow much to fragment? ļ‚How to test correctness? ļ‚How to allocate? ļ‚‘Information requirements?
  • 7. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/7 Fragmentation ā€¢ Can't we just distribute relations? ā€¢ What is a reasonable unit of distribution? āž” relation āœ¦ views are subsets of relations ļƒØlocality āœ¦ extra communication āž” fragments of relations (sub-relations) āœ¦ concurrent execution of a number of transactions that access different portions of a relation āœ¦ views that cannot be defined on a single fragment will require extra processing āœ¦ semantic data control (especially integrity enforcement) more difficult
  • 8. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/8 Fragmentation Alternatives ā€“ Horizontal PROJ1 : projects with budgets less than $200,000 PROJ2 : projects with budgets greater than or equal to $200,000 PROJ1 PNO PNAME BUDGET LOC P3 CAD/CAM 250000 New York P4 Maintenance 310000 Paris P5 CAD/CAM 500000 Boston PNO PNAME LOC P1 Instrumentation 150000 Montreal P2 Database Develop. 135000 New York BUDGET PROJ2 New York New York PROJ PNO PNAME BUDGET LOC P1 Instrumentation 150000 Montreal P3 CAD/CAM 250000 P2 Database Develop. 135000 P4 Maintenance 310000 Paris P5 CAD/CAM 500000 Boston
  • 9. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/9 Fragmentation Alternatives ā€“ Vertical PROJ1: information about project budgets PROJ2: information about project names and locations PNO BUDGET P1 150000 P3 250000 P2 135000 P4 310000 P5 500000 PNO PNAME LOC P1 Instrumentation Montreal P3 CAD/CAM New York P2 Database Develop. New York P4 Maintenance Paris P5 CAD/CAM Boston PROJ1 PROJ2 New York New York PROJ PNO PNAME BUDGET LOC P1 Instrumentation 150000 Montreal P3 CAD/CAM 250000 P2 Database Develop. 135000 P4 Maintenance 310000 Paris P5 CAD/CAM 500000 Boston
  • 10. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/10 Degree of Fragmentation Finding the suitable level of partitioning within this range tuples or attributes relations finite number of alternatives
  • 11. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/11 Correctness of Fragmentation ā€¢ Completeness āž” Decomposition of relation R into fragments R1, R2, ..., Rn is complete if and only if each data item in R can also be found in some Ri ā€¢ Reconstruction āž” If relation R is decomposed into fragments R1, R2, ..., Rn, then there should exist some relational operator āˆ‡ such that R = āˆ‡1ā‰¤iā‰¤nRi ā€¢ Disjointness āž” If relation R is decomposed into fragments R1, R2, ..., Rn, and data item di is in Rj, then di should not be in any other fragment Rk (k ā‰  j ).
  • 12. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/12 Allocation Alternatives ā€¢ Non-replicated āž” partitioned : each fragment resides at only one site ā€¢ Replicated āž” fully replicated : each fragment at each site āž” partially replicated : each fragment at some of the sites ā€¢ Rule of thumb: If read-only queries update queries << 1, replication is advantageous, otherwise replication may cause problems
  • 13. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/13 Full-replication Partial-replication Partitioning QUERY PROCESSING Easy Same Difficulty Same DifficultyDIRECTORY MANAGEMENT Easy or Non-existant CONCURRENCY CONTROL EasyDifficultModerate RELIABILITY Very high High Low REALITY Possible application Realistic Possible application Comparison of Replication Alternatives
  • 14. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/14 Information Requirements ā€¢ Four categories: āž” Database information āž” Application information āž” Communication network information āž” Computer system information
  • 15. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/15 Fragmentation ā€¢ Horizontal Fragmentation (HF) āž” Primary Horizontal Fragmentation (PHF) āž” Derived Horizontal Fragmentation (DHF) ā€¢ Vertical Fragmentation (VF) ā€¢ Hybrid Fragmentation (HF)
  • 16. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/16 PHF ā€“ Information Requirements ā€¢ Database Information āž” relationship āž” cardinality of each relation: card(R) TITLE, SAL SKILL ENO, ENAME, TITLE PNO, PNAME, BUDGET, LO C ENO, PNO, RESP, DUR EMP PROJ ASG L1
  • 17. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/17 PHF - Information Requirements ā€¢ Application Information āž” simple predicates : Given R[A1, A2, ā€¦, An], a simple predicate pj is pj : Ai ĪøValue where Īø {=,<,ā‰¤,>,ā‰„,ā‰ }, Value Di and Di is the domain of Ai. For relation R we define Pr = {p1, p2, ā€¦,pm} Example : PNAME = "Maintenance" BUDGET ā‰¤ 200000 āž” minterm predicates : Given R and Pr = {p1, p2, ā€¦,pm} define M = {m1,m2,ā€¦,mr} as M = { mi | mi = pj Pr pj* }, 1ā‰¤jā‰¤m, 1ā‰¤iā‰¤z where pj* = pj or pj* = Ā¬(pj).
  • 18. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/18 PHF ā€“ Information Requirements Example m1: PNAME="Maintenance" BUDGETā‰¤200000 m2: NOT(PNAME="Maintenance") BUDGETā‰¤200000 m3: PNAME= "Maintenance" NOT(BUDGETā‰¤200000) m4: NOT(PNAME="Maintenance") NOT(BUDGETā‰¤200000)
  • 19. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/19 PHF ā€“ Information Requirements ā€¢ Application Information āž” minterm selectivities: sel(mi) āœ¦ The number of tuples of the relation that would be accessed by a user query which is specified according to a given minterm predicate mi. āž” access frequencies: acc(qi) āœ¦ The frequency with which a user application qi accesses data. āœ¦ Access frequency for a minterm predicate can also be defined.
  • 20. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/20 Primary Horizontal Fragmentation Definition : Rj = Fj (R), 1 ā‰¤ j ā‰¤ w where Fj is a selection formula, which is (preferably) a minterm predicate. Therefore, A horizontal fragment Ri of relation R consists of all the tuples of R which satisfy a minterm predicate mi. ļƒŖ Given a set of minterm predicates M, there are as many horizontal fragments of relation R as there are minterm predicates. Set of horizontal fragments also referred to as minterm fragments.
  • 21. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/21 PHF ā€“ Algorithm Given: A relation R, the set of simple predicates Pr Output: The set of fragments of R = {R1, R2,ā€¦,Rw} which obey the fragmentation rules. Preliminaries : āž” Pr should be complete āž” Pr should be minimal
  • 22. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/22 Completeness of Simple Predicates ā€¢ A set of simple predicates Pr is said to be complete if and only if the accesses to the tuples of the minterm fragments defined on Pr requires that two tuples of the same minterm fragment have the same probability of being accessed by any application. ā€¢ Example : āž” Assume PROJ[PNO,PNAME,BUDGET,LOC] has two applications defined on it. āž” Find the budgets of projects at each location. (1) āž” Find projects with budgets less than $200000. (2)
  • 23. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/23 Completeness of Simple Predicates According to (1), Pr={LOC=ā€œMontrealā€,LOC=ā€œNew Yorkā€,LOC=ā€œParisā€} which is not complete with respect to (2). Modify Pr ={LOC=ā€œMontrealā€,LOC=ā€œNew Yorkā€,LOC=ā€œParisā€, BUDGETā‰¤200000,BUDGET>200000} which is complete.
  • 24. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/24 Minimality of Simple Predicates ā€¢ If a predicate influences how fragmentation is performed, (i.e., causes a fragment f to be further fragmented into, say, fi and fj) then there should be at least one application that accesses fi and fj differently. ā€¢ In other words, the simple predicate should be relevant in determining a fragmentation. ā€¢ If all the predicates of a set Pr are relevant, then Pr is minimal. acc(mi ) card( fi ) = acc(mj ) card( fj )
  • 25. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/25 Minimality of Simple Predicates Example : Pr ={LOC=ā€œMontrealā€,LOC=ā€œNew Yorkā€, LOC=ā€œParisā€, BUDGETā‰¤200000,BUDGET>200000} is minimal (in addition to being complete). However, if we add PNAME = ā€œInstrumentationā€ then Pr is not minimal.
  • 26. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/26 COM_MIN Algorithm Given: a relation R and a set of simple predicates Pr Output: a complete and minimal set of simple predicates Pr' for Pr Rule 1: a relation or fragment is partitioned into at least two parts which are accessed differently by at least one application.
  • 27. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/27 COM_MIN Algorithm ļ‚Œ Initialization : āž” find a pi Pr such that pi partitions R according to Rule 1 āž” set Pr' = pi ; Pr Pr ā€“ {pi} ; F {fi} ļ‚ Iteratively add predicates to Pr' until it is complete āž” find a pj Pr such that pj partitions some fk defined according to minterm predicate over Pr' according to Rule 1 āž” set Pr' = Pr' {pi}; Pr Pr ā€“ {pi}; F F {fi} āž” if pk Pr' which is nonrelevant then Pr' Pr ā€“ {pi} F F ā€“ {fi}
  • 28. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/28 PHORIZONTAL Algorithm Makes use of COM_MIN to perform fragmentation. Input: a relation R and a set of simple predicates Pr Output: a set of minterm predicates M according to which relation R is to be fragmented ļ‚Œ Pr' COM_MIN (R,Pr) ļ‚ determine the set M of minterm predicates ļ‚Ž determine the set I of implications among pi Pr ļ‚ eliminate the contradictory minterms from M
  • 29. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/29 PHF ā€“ Example ā€¢ Two candidate relations : PAY and PROJ. ā€¢ Fragmentation of relation PAY āž” Application: Check the salary info and determine raise. āž” Employee records kept at two sites ļƒžapplication run at two sites āž” Simple predicates p1 : SAL ā‰¤ 30000 p2 : SAL > 30000 Pr = {p1,p2} which is complete and minimal Pr'=Pr āž” Minterm predicates m1 : (SAL ā‰¤ 30000) m2 : NOT(SAL ā‰¤ 30000) (SAL > 30000)
  • 30. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/30 PHF ā€“ Example TITLE Mech. Eng. Programmer SAL 27000 24000 PAY1 PAY2 TITLE Elect. Eng. Syst. Anal. SAL 40000 34000
  • 31. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/31 PHF ā€“ Example ā€¢ Fragmentation of relation PROJ āž” Applications: āœ¦ Find the name and budget of projects given their no. āœ“ Issued at three sites āœ¦ Access project information according to budget āœ“ one site accesses ā‰¤200000 other accesses >200000 āž” Simple predicates āž” For application (1) p1 : LOC = ā€œMontrealā€ p2 : LOC = ā€œNew Yorkā€ p3 : LOC = ā€œParisā€ āž” For application (2) p4 : BUDGET ā‰¤ 200000 p5 : BUDGET > 200000 āž” Pr = Pr' = {p1,p2,p3,p4,p5}
  • 32. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/32 ā€¢ Fragmentation of relation PROJ continued āž” Minterm fragments left after elimination m1 : (LOC = ā€œMontrealā€) (BUDGET ā‰¤ 200000) m2 : (LOC = ā€œMontrealā€) (BUDGET > 200000) m3 : (LOC = ā€œNew Yorkā€) (BUDGET ā‰¤ 200000) m4 : (LOC = ā€œNew Yorkā€) (BUDGET > 200000) m5 : (LOC = ā€œParisā€) (BUDGET ā‰¤ 200000) m6 : (LOC = ā€œParisā€) (BUDGET > 200000) PHF ā€“ Example
  • 33. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/33 PHF ā€“ Example PROJ1 PNO PNAME BUDGET LOC PNO PNAME BUDGET LOC P1 Instrumentation 150000 Montreal P2 Database Develop. 135000 New York PROJ2 PROJ4 PROJ6 PNO PNAME BUDGET LOC P3 CAD/CAM 250000 New York PNO PNAME BUDGET LOC MaintenanceP4 310000 Paris
  • 34. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/34
  • 35. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/35 ā€¢ Completeness āž” Since Pr' is complete and minimal, the selection predicates are complete ā€¢ Reconstruction āž” If relation R is fragmented into FR = {R1,R2,ā€¦,Rr} R = Ri FR Ri ā€¢ Disjointness āž” Minterm predicates that form the basis of fragmentation should be mutually exclusive. PHF ā€“ Correctness
  • 36. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/36 Derived Horizontal Fragmentation ā€¢ Defined on a member relation of a link according to a selection operation specified on its owner. āž” Each link is an equijoin. āž” Equijoin can be implemented by means of semijoins. TITLE,SAL SKILL ENO, ENAME, TITLE PNO, PNAME, BUDGET, LOC ENO, PNO, RESP, DUR EMP PROJ ASG L1 L2 L3
  • 37. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/37 DHF ā€“ Definition Given a link L where owner(L)=S and member(L)=R, the derived horizontal fragments of R are defined as Ri = R ā‹‰F Si, 1ā‰¤iā‰¤w where w is the maximum number of fragments that will be defined on R and Si = Fi (S) where Fi is the formula according to which the primary horizontal fragment Si is defined.
  • 38. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/38 Given link L1 where owner(L1)=SKILL and member(L1)=EMP EMP1 = EMP ā‹‰ SKILL1 EMP2 = EMP ā‹‰ SKILL2 where SKILL1 = SALā‰¤30000(SKILL) SKILL2 = SAL>30000(SKILL) DHF ā€“ Example ENO ENAME TITLE E3 A. Lee Mech. Eng. E4 J. Miller Programmer E7 R. Davis Mech. Eng. EMP1 ENO ENAME TITLE E1 J. Doe Elect. Eng. E2 M. Smith Syst. Anal. E5 B. Casey Syst. Anal. EMP2 E6 L. Chu Elect. Eng. E8 J. Jones Syst. Anal.
  • 39. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/39 DHF ā€“ Correctness ā€¢ Completeness āž” Referential integrity āž” Let R be the member relation of a link whose owner is relation S which is fragmented as FS = {S1, S2, ..., Sn}. Furthermore, let A be the join attribute between R and S. Then, for each tuple t of R, there should be a tuple t' of S such that t[A] = t' [A] ā€¢ Reconstruction āž” Same as primary horizontal fragmentation. ā€¢ Disjointness āž” Simple join graphs between the owner and the member fragments.
  • 40. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/40 ā€¢ Has been studied within the centralized context āž” design methodology āž” physical clustering ā€¢ More difficult than horizontal, because more alternatives exist. Two approaches : āž” grouping āœ¦ attributes to fragments āž” splitting āœ¦ relation to fragments Vertical Fragmentation
  • 41. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/41 ā€¢ Overlapping fragments āž” grouping ā€¢ Non-overlapping fragments āž” splitting We do not consider the replicated key attributes to be overlapping. Advantage: Easier to enforce functional dependencies (for integrity checking etc.) Vertical Fragmentation
  • 42. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/42 VF ā€“ Information Requirements ā€¢ Application Information āž” Attribute affinities āœ¦ a measure that indicates how closely related the attributes are āœ¦ This is obtained from more primitive usage data āž” Attribute usage values āœ¦ Given a set of queries Q = {q1, q2,ā€¦, qq} that will run on the relation R[A1, A2,ā€¦, An], use(qi,ā€¢) can be defined accordingly use(qi,Aj) = 1 if attribute Aj is referenced by query qi 0 otherwise
  • 43. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/43 VF ā€“ Definition of use(qi,Aj) Consider the following 4 queries for relation PROJ q1:SELECT BUDGET q2: SELECT PNAME,BUDGET FROM PROJ FROM PROJ WHERE PNO=Value q3:SELECT PNAME q4: SELECT SUM(BUDGET) FROM PROJ FROM PROJ WHERE LOC=Value WHERE LOC=Value Let A1= PNO, A2= PNAME, A3= BUDGET, A4= LOC q1 q2 q3 q4 A1 1 0 1 0 0 01 1 0 01 1 0 0 1 1 A2 A3 A4
  • 44. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/44 VF ā€“ Affinity Measure aff(Ai,Aj) The attribute affinity measure between two attributes Ai and Aj of a relation R[A1, A2, ā€¦, An] with respect to the set of applications Q = (q1, q2, ā€¦, qq) is defined as follows : aff (Ai, Aj) (query access) all queries that access Ai and Aj query access access frequency of a query access execution all sites
  • 45. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/45 Assume each query in the previous example accesses the attributes once during each execution. Also assume the access frequencies Then aff(A1, A3) = 15*1 + 20*1+10*1 = 45 and the attribute affinity matrix AA is VF ā€“ Calculation of aff(Ai, Aj) 4 q1 q 2 q3 q S1 S2 S3 15 20 10 5 0 0 25 2525 3 0 0 A A A A1 2 3 4 A A A A 1 2 3 4 45 0 45 0 0 80 5 75 45 5 53 3 0 75 3 78
  • 46. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/46 ā€¢ Take the attribute affinity matrix AA and reorganize the attribute orders to form clusters where the attributes in each cluster demonstrate high affinity to one another. ā€¢ Bond Energy Algorithm (BEA) has been used for clustering of entities. BEA finds an ordering of entities (in our case attributes) such that the global affinity measure is maximized. VF ā€“ Clustering Algorithm AM (affinity of Ai and Aj with their neighbors) ji
  • 47. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/47 Bond Energy Algorithm Input: The AA matrix Output: The clustered affinity matrix CA which is a perturbation of AA ļ‚ŒInitialization: Place and fix one of the columns of AA in CA. ļ‚Iteration: Place the remaining n-i columns in the remaining i+1 positions in the CA matrix. For each column, choose the placement that makes the most contribution to the global affinity measure. ļ‚ŽRow order: Order the rows according to the column ordering.
  • 48. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/48 Bond Energy Algorithm ā€œBestā€ placement? Define contribution of a placement: cont(Ai, Ak, Aj) = 2bond(Ai, Ak)+2bond(Ak, Al) ā€“2bond(Ai, Aj) where bond(Ax,Ay) = aff(Az,Ax)aff(Az,Ay) z 1 n
  • 49. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/49 BEA ā€“ Example Consider the following AA matrix and the corresponding CA matrix where A1 and A2 have been placed. Place A3: Ordering (0-3-1) : cont(A0,A3,A1) = 2bond(A0 , A3)+2bond(A3 , A1)ā€“2bond(A0 , A1) = 2* 0 + 2* 4410 ā€“ 2*0 = 8820 Ordering (1-3-2) : cont(A1,A3,A2) = 2bond(A1 , A3)+2bond(A3 , A2)ā€“2bond(A1,A2) = 2* 4410 + 2* 890 ā€“ 2*225 = 10150 Ordering (2-3-4) : cont (A2,A3,A4) = 1780
  • 50. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/50 BEA ā€“ Example ā€¢ Therefore, the CA matrix has the form ā€¢ When A4 is placed, the final form of the CA matrix (after row organization) is A1 A2A3 45 0 45 0 45 5 53 3 0 80 5 75 A1 A2A3 A4 A1 A2 A3 A4 45 45 0 0 45 53 5 3 0 5 80 75 0 3 75 78
  • 51. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/51 How can you divide a set of clustered attributes {A1, A2, ā€¦, An} into two (or more) sets {A1, A2, ā€¦, Ai} and {Ai, ā€¦, An} such that there are no (or minimal) applications that access both (or more than one) of the sets. VF ā€“ Algorithm A1 A2 Ai Ai+1 Am ā€¦A1 A2 A3 Ai Ai+1 Am BA . . . TA
  • 52. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/52 Define TQ = set of applications that access only TA BQ = set of applications that access only BA OQ = set of applications that access both TA and BA and CTQ = total number of accesses to attributes by applications that access only TA CBQ = total number of accesses to attributes by applications that access only BA COQ = total number of accesses to attributes by applications that access both TA and BA Then find the point along the diagonal that maximizes VF ā€“ ALgorithm CTQ CBQ COQ2
  • 53. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/53 Two problems : ļƒžCluster forming in the middle of the CA matrix āž” Shift a row up and a column left and apply the algorithm to find the ā€œbestā€ partitioning point āž” Do this for all possible shifts āž” Cost O(m2) ļƒžMore than two clusters āž” m-way partitioning āž” try 1, 2, ā€¦, mā€“1 split points along diagonal and try to find the best point for each of these āž” Cost O(2m) VF ā€“ Algorithm
  • 54. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/54 VF ā€“ Correctness A relation R, defined over attribute set A and key K, generates the vertical partitioning FR = {R1, R2, ā€¦, Rr}. ā€¢ Completeness āž” The following should be true for A: A = ARi ā€¢ Reconstruction āž” Reconstruction can be achieved by R = ā‹ˆā€¢K Ri, Ri FR ā€¢ Disjointness āž” TID's are not considered to be overlapping since they are maintained by the system āž” Duplicated keys are not considered to be overlapping
  • 55. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/55 Hybrid Fragmentation R HFHF R1 VF VFVFVFVF R11 R12 R21 R22 R23 R2
  • 56. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/56 Fragment Allocation ā€¢ Problem Statement Given F = {F1, F2, ā€¦, Fn} fragments S ={S1, S2, ā€¦, Sm} network sites Q = {q1, q2,ā€¦, qq} applications Find the "optimal" distribution of F to S. ā€¢ Optimality āž” Minimal cost āœ¦ Communication + storage + processing (read & update) āœ¦ Cost in terms of time (usually) āž” Performance Response time and/or throughput āž” Constraints āœ¦ Per site constraints (storage & processing)
  • 57. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/57 Information Requirements ā€¢ Database information āž” selectivity of fragments āž” size of a fragment ā€¢ Application information āž” access types and numbers āž” access localities ā€¢ Communication network information āž” unit cost of storing data at a site āž” unit cost of processing at a site ā€¢ Computer system information āž” bandwidth āž” latency āž” communication overhead
  • 58. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/58 Allocation File Allocation (FAP) vs Database Allocation (DAP): āž” Fragments are not individual files āœ¦ relationships have to be maintained āž” Access to databases is more complicated āœ¦ remote file access model not applicable āœ¦ relationship between allocation and query processing āž” Cost of integrity enforcement should be considered āž” Cost of concurrency control should be considered
  • 59. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/59 Allocation ā€“ Information Requirements ā€¢ Database Information āž” selectivity of fragments āž” size of a fragment ā€¢ Application Information āž” number of read accesses of a query to a fragment āž” number of update accesses of query to a fragment āž” A matrix indicating which queries updates which fragments āž” A similar matrix for retrievals āž” originating site of each query ā€¢ Site Information āž” unit cost of storing data at a site āž” unit cost of processing at a site ā€¢ Network Information āž” communication cost/frame between two sites āž” frame size
  • 60. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/60 General Form min(Total Cost) subject to response time constraint storage constraint processing constraint Decision Variable Allocation Model xij 1 if fragment Fi is stored at site Sj 0 otherwise
  • 61. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/61 ā€¢ Total Cost ā€¢ Storage Cost (of fragment Fj at Sk) ā€¢ Query Processing Cost (for one query) processing component + transmission component Allocation Model (unit storage cost at Sk) (size of Fj) xjk query processing cost all queries cost of storing a fragment at a site all fragmentsall sites
  • 62. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/62 Allocation Model ā€¢ Query Processing Cost Processing component access cost + integrity enforcement cost + concurrency control cost āž” Access cost āž” Integrity enforcement and concurrency control costs āœ¦ Can be similarly calculated (no. of update accesses+ no. of read accesses) all fragmentsall sites xij local processing cost at a site
  • 63. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/63 ā€¢ Query Processing Cost Transmission component cost of processing updates + cost of processing retrievals āž” Cost of updates āž” Retrieval Cost Allocation Model update message cost all fragmentsall sites acknowledgment cost all fragmentsall sites minall sites all fragments (cost of retrieval command cost of sending back the result)
  • 64. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/64 Allocation Model ā€¢ Constraints āž” Response Time execution time of query ā‰¤ max. allowable response time for that query āž” Storage Constraint (for a site) āž” Processing constraint (for a site) storage requirement of a fragment at that site all fragments storage capacity at that site processing load of a query at that site all queries processing capacity of that site
  • 65. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/65 Allocation Model ā€¢ Solution Methods āž” FAP is NP-complete āž” DAP also NP-complete ā€¢ Heuristics based on āž” single commodity warehouse location (for FAP) āž” knapsack problem āž” branch and bound techniques āž” network flow
  • 66. Distributed DBMS Ā© M. T. Ɩzsu & P. Valduriez Ch.3/66 Allocation Model ā€¢ Attempts to reduce the solution space āž” assume all candidate partitionings known; select the ā€œbestā€ partitioning āž” ignore replication at first āž” sliding window on fragments