0% found this document useful (0 votes)
8 views33 pages

Distribution Design

Uploaded by

Shahzaib
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views33 pages

Distribution Design

Uploaded by

Shahzaib
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 33

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/1
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/2


Dimensions of the Problem
Access pattern behavior
dynamic
static
partial
information
data
Level of knowledge
data + complete
program information

Level of sharing

Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/3


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/4


Top-Down Design
Requirements
Analysis

Objectives
User Input
Conceptual View Integration View Design
Design

Access
GCS Information ES’s

Distribution
Design User Input

LCS’s

Physical
Design

LIS’s
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/5
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/6


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/7


Fragmentation Alternatives –
Horizontal
PROJ
PROJ1 : projects with budgets less than PNO PNAME BUDGET LOC
$200,000 P1 Instrumentation 150000 Montreal
P2 Database Develop. 135000 New York
PROJ2 : projects with budgets greater P3 CAD/CAM 250000 New York
P4 Maintenance 310000 Paris
than or equal to $200,000 P5 CAD/CAM 500000 Boston

PROJ1 PROJ2

PNO PNAME BUDGET LOC PNO PNAME BUDGET LOC


P1 Instrumentation 150000 Montreal P3 CAD/CAM 250000 New York
P2 Database Develop. 135000 New York P4 Maintenance 310000 Paris
P5 CAD/CAM 500000 Boston

Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/8


Fragmentation Alternatives –
Vertical
PROJ
PROJ1: information about project PNO PNAME BUDGET LOC

budgets P1 Instrumentation 150000 Montreal


P2 Database Develop. 135000 New York
PROJ2: information about project P3 CAD/CAM 250000 New York
P4 Maintenance 310000 Paris
names and locations P5 CAD/CAM 500000 Boston

PROJ1 PROJ2
PNO BUDGET PNO PNAME LOC

P1 150000 P1 Instrumentation Montreal


P2 135000 P2 Database Develop. New York
P3 250000 P3 CAD/CAM New York
P4 310000 P4 Maintenance Paris
P5 500000 P5 CAD/CAM Boston

Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/9


Degree of Fragmentation

finite number of alternatives

tuples relations
or
attributes

Finding the suitable level of partitioning within this


range

Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/10


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 relationship in between.
• 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.

Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/11


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:

Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/12


Comparison of Replication
Alternatives
Full-replication Partial-replication Partitioning

QUERY Same Difficulty


Easy
PROCESSING

DIRECTORY Easy or Same Difficulty


MANAGEMENT Non-existant

CONCURRENCY
Moderate Difficult Easy
CONTROL

RELIABILITY Very high High Low

Possible Possible
REALITY Realistic
application application
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/13
Information Requirements
• Four categories:
➡ Database information
➡ Application information
➡ Communication network information
➡ Computer system information

Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/14


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/15


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/16


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/17


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/18


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/19


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/20


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/21


PHF – Example

PAY1 PAY2
TITLE SAL TITLE SAL
Mech. Eng. 27000 Elect. Eng. 40000
Programmer 24000 Syst. Anal. 34000

Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/22


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' = {p ,p ,p ,p ,p }
1 2 3 4 5
Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/23
PHF – Example
• 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)

Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/24


PHF – Example

PROJ1 PROJ2

PNO PNAME BUDGET LOC PNO PNAME BUDGET LOC

Database
P1 Instrumentation 150000 Montreal P2 135000 New York
Develop.

PROJ4 PROJ6

PNO PNAME BUDGET LOC PNO PNAME BUDGET LOC

P3 CAD/CAM 250000 New P4 Maintenance 310000 Paris


York

Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/25


Vertical Fragmentation
• 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

Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/26


Vertical Fragmentation
• 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.)

Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/27


Hybrid Fragmentation
R
HF HF

R1 R2
VF VF VF VF VF

R11 R12 R21 R22 R23

Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/28


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
➡ communication overhead

Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/29


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/30


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/31


Allocation Model
General Form
min(Total Cost)
subject to
response time constraint
storage constraint
processing constraint

Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/32


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

Distributed DBMS © M. T. Özsu & P. Valduriez Ch.3/33

You might also like