




































Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!





































Design problem
Design strategies(top-down, bottom-up)
Fragmentation
Allocation and replication of fragments, optimality, heuristics
Acknowledgements:
I am indebted to Arturas Mazeika for providing me his slides of this course.
J. Gamper
Design Problem
Design problem of distributed systems
: 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 DDBMS, the distribution of applications involves
-
Distribution of the DDBMS software
Distribution of applications that run on the database
of data is studied.Distribution of applications will not be considered in the following; instead the distribution
J. Gamper
Design Strategies
Top-down approach
-
Designing systems from scratch
Homogeneous systems
Bottom-up approach
-
The databases already exist at a number of sites
The databases should be connected to solve common tasks
J. Gamper
Design Strategies...
Top-down design strategy
J. Gamper
Design Strategies...
Bottom-up design strategy
J. Gamper
Fragmentation
What is a reasonable unit of distribution? Relation or fragment of relation?
Relations
as unit of distribution:
If the relation is not replicated, we get a high volume of remote data accesses.
executing updates and waste disk spaceIf the relation is replicated, we get unnecessary replications, which cause problems in
the only sites that uses the dataMight be an Ok solution, if queries need all the data in the relation and data stays at
Fragments
of relationas as unit of distribution:
Application views are usually subsets of relations
Thus, locality of accesses of applications is defined on subsets of relations
different portions of a relationPermits a number of transactions to execute concurrently, since they will access
Parallel execution of a single query (intra-query concurrency)
However, semantic data control (especially integrity enforcement) is more difficult
Fragments of relations are (usually) the appropriate unit of distribution.
J. Gamper
Fragmentation...
Types of Fragmentation
-
Horizontal: partitions a relation along its tuples
Vertical: partitions a relation along its attributes
Mixed/hybrid: a combination of horizontal and vertical fragmentation
(a) Horizontal Fragmentation
(b) Vertical Fragmentation
(c) Mixed Fragmentation
J. Gamper
Fragmentation...
Exampe
Data
E-R Diagram
J. Gamper
Fragmentation...
Example (contd.):
Vertical fragmentation of PROJ relation
PROJ1: information about project budgets
PROJ2: information about project names and locations
J. Gamper
Correctness Rules of Fragmentation
Completeness
-
Decomposition of relation
into fragments
1
2
n
is complete iff each
data item in
can also be found in some
i .
Reconstruction
-
If relation
is decomposed into fragments
1
2
n
, then there should exist
some relational operator
that reconstructs
from its fragments, i.e.,
1
n
Union to combine horizontal fragments
Join to combine vertical fragments
Disjointness
-
If relation
is decomposed into fragments
1
2
n
and data item
i
appears in fragment
j (^) , then
i
should not appear in any other fragment
k
,
For horizontal fragmentation, data item is a tuple
For vertical fragmentation, data item is an attribute
J. Gamper
Page 14
Horizontal Fragmentation...
Computing
horizontal fragmentation (idea)
Compute the
frequency
of the individual queries of the site
1
Q
conjunctions); the conjunctions are calledRewrite the queries of the site in the conjunctive normal form (disjunction of
minterms
Compute the
selectivity
of the minterms
Find the
minimal
and
complete
set of minterms (predicates)
The set of predicates is
complete
if and only if any two tuples in the same fragment
are referenced with the same probability by any application
The set of predicates is
minimal
if and only if there is at least one query that
accesses the fragment
and
(pp 120-122) of the textbook of the course) J. Gamper
Horizontal Fragmentation...
Example:
Fragmentation of the
relation
Consider the following query:
Find the name and budget of projects given their PNO.
The query is issued at all three sites
′
′
′
′
′
′
1
=
σ
LOC
=
′ M ontreal
′ (^ P ROJ
PNO
PNAME
BUDGET
LOC
P
Instrumentation
150000
Montreal
2
=
σ
LOC
=
′ N ewY ork
′ (^ P ROJ
PNO
PNAME
BUDGET
LOC
P
Database Develop.
135000
New York
P
CAD/CAM
250000
New York
3
=
σ
LOC
=
′ P aris
′ (^ P ROJ
PNO
PNAME
BUDGET
LOC
P
Maintenance
310000
Paris
If access is only according to the location, the above set of predicates is complete
-
i.e., each tuple of each fragment
i
has the same probability of being accessed
budget is less than $200000, the set of predicates is not complete.If there is a second query/application to access only those project tuples where the
-
in
2
has higher probability to be accessed
J. Gamper
Horizontal Fragmentation...
Example (contd.):
Now,
2
will be split in two fragments
1
=
σ
LOC
=
′ M ontreal
′ (^) ( P ROJ
PNO
PNAME
BUDGET
LOC
P
Instrumentation
150000
Montreal
2
=
σ
LOC
=
′ N Y
(^) ′ ∧ BU DGET <
200000
PNO
PNAME
BUDGET
LOC
P
Database Develop.
135000
New York
3
=
σ
LOC
=
′ P aris
′ (^ P ROJ
PNO
PNAME
BUDGET
LOC
P
Maintenance
310000
Paris
(^2) ′
=
σ
LOC
=
′ N Y
(^) ′ ∧ BU DGET
(^) ≥
200000
PNO
PNAME
BUDGET
LOC
P
CAD/CAM
250000
New York
1
and
2
would have been split in a similar way if tuples with budgets
smaller and greater than 200.000 would be stored
J. Gamper
Page 19
Horizontal Fragmentation...
In most cases intuition can be used to build horizontal partitions. Let
1
2
3
4
5
, and
2
3
4
5
be query results. Then tuples would be fragmented in the
following way:
J. Gamper