You are on page 1of 7

Chapter 12 Distributed Database Management Systems

Problem Solutions
The first problem is based on the DDBMS scenario in Figure P12.1.

Figure P12.1 The DDBMS Scenario for Problem 1


T B!"S
C(ST&M"# P#&D(CT '%+&'C" '%+*!'%"

F# $M"%TS
%) P#&D* P#&D*B %) %)

!&C T'&%

B B B

1. Specify the minimum type,s- of operation,s- the database must support ,remote re.uest/ remote transaction/ distributed transaction/ or distributed re.uest- in order to perform the follo0ing operations1

%&T"
To ans0er the follo0ing .uestions/ 2eep in mind that the 2ey to each ans0er is in the number of different data processors that are accessed by each re.uest)transaction. First identify ho0 many different DP sites are to be accessed by the transaction)re.uest. %e3t/ remember that a distributed re.uest is necessary if a single S4! statement is to access more than one DP site. (se the follo0ing summary1 %umber of DPs &peration #e.uest Transaction 1 #emote #emote 51 Distributed Distributed

Based on this summary/ the .uestions are ans0ered easily.

t C1 a. S"!"CT F#&M 6 C(ST&M"#7

This SQL sequence represents a remote request. b. S"!"CT F#&M 89"#" 6 '%+&'C" '%+*T&T ! 5 1:::7

This SQL sequence represents a remote request. c. S"!"CT F#&M 89"#" 6 P#&D(CT P#&D*4&9 ; 1:7

This SQL sequence represents a distributed request. Note that the distributed request is required when a single request must access two DP sites. The PRODU T table is composed o! two !ragments" PRO#$ and PROD#%" which are located in sites $ and %" respecti&el'. d. B"$'% 8&#<7 (PD T" C(ST&M"# S"T C(S*B ! %C" = C(S*B ! %C" > 1:: 89"#" C(S*%(M=?1:@AB?7 '%S"#T '%T& '%+&'C",'%+*%(M/ C(S*%(M/ '%+*D T"/ '%+*T&T !+ !("S ,?@CBA@1?/ ?1:@AB?/ D1EFF"BF2:12G/ 1::-7 '%S"#T '%T& '%+!'%",'%+*%(M/ P#&D*C&D"/ !'%"*P#'C"+ !("S ,?@CBA@1?/ ?1:2A?/ 1::-7

(PD T" P#&D(CT S"T P#&D*4&9 = P#&D*4&9 F 1 89"#" P#&D*C&D" = ?1:2A?7 C&MM'T 8&#<7 This SQL sequence represents a distributed request. Note that UPD$T( USTO)(R and the two *NS(RT statements onl' require remote request capabilities. +owe&er" the entire transaction must access more than one remote DP site" so we also need distributed transaction capabilit'. The last UPD$T( PRODU T statement accesses two remote sites because the PRODU T table is di&ided into two !ragments located at two remote DP sites. There!ore" the transaction as a whole requires distributed request capabilit'. e. B"$'% 8&#<7 '%S"#T C(ST&M"#,C(S*%(M/ C(S*% M"/ C(S* DD#"SS/ C(S*B !+ !("S ,?AH21:?/?+ictor "phanor?/ ?12A Main St?/ :.::-7 '%S"#T '%T& '%+&'C",'%+*%(M/ C(S*%(M/ '%+*D T"/ '%+*T&T !+ !("S ,?@CBHAH?/ ?AH21:?/ D1:F ($F2:11G/ 2.::-7 C&MM'T 8&#<7 This SQL sequence represents a distributed transaction. Note that" in this transaction" each indi&idual request requires onl' remote request capabilities. +owe&er" the transaction as a whole accesses two remote sites. There!ore" distributed request capabilit' is required. t 1 f. S"!"CT F#&M 89"#" C(S*%(M/ C(S*% M"/ '%+*T&T ! C(ST&M"#/ '%+&'C" C(ST&M"#.C(S*%(M = '%+&'C".C(S*%(M7

This SQL sequence represents a distributed request. Note that the request accesses two DP sites" one local and one remote. There!ore distributed capabilit' is needed. g. S"!"CT F#&M 89"#" 6 '%+&'C" '%+*T&T ! 5 1:::7

This SQL sequence represents a remote request" because it accesses onl' one remote DP site. h. S"!"CT F#&M 89"#" 6 P#&D(CT P#&D*4&9 ; 1:7

This SQL sequence represents a distributed request. *n this case" the PRODU T table is partitioned between two DP sites" $ and %. $lthough the request accesses onl' one remote DP site" it accesses a table that is partitioned into two !ragments, PROD-$ and PROD-%. single re.uest can access a partitioned table only if the DBMS supports distributed re.uests.

t B1 i. S"!"CT F#&M 6 C(ST&M"#7

This SQL sequence represents a remote request. I. S"!"CT F#&M 89"#" C(S*% M"/ '%+*T&T ! C(ST&M"#/ '%+&'C" '%+*T&T ! 5 1::: %D C(ST&M"#.C(S*%(M = '%+&'C".C(S*%(M7

This SQL sequence represents a distributed request. 2. S"!"CT F#&M 89"#" 6 P#&D(CT P#&D*4&9 ; 1:7

This SQL sequence represents a distributed request. .See e/planation !or part h.0 2. The follo0ing data structure and constraints e3ist for a magaJine publishing company. a. The company publishes one regional magaJine each in Florida ,F!-/ South Carolina ,SC-/ $eorgia ,$ -/ and Tennessee ,T%-. b. The company has A::/::: customers ,subscribers- distributed throughout the four states listed in Part a. c. &n the first of each month/ an annual subscription '%+&'C" is printed and sent to each customer 0hose subscription is due for rene0al. The '%+&'C" entity contains a #"$'&% attribute to indicate the state ,F!/ SC/ $ / T%- in 0hich the customer resides1
C(ST&M"# ,C(S*%(M/ C(S*% M"/ C(S* DD#"SS/ C(S*C'TK/ C(S*ST T"/ C(S*L'P/ C(S*S(BSD T"'%+&'C" ,'%+*%(M/ '%+*#"$'&%/ C(S*%(M/ '%+*D T"/ '%+*T&T !-

The company?s management is a0are of the problems associated 0ith centraliJed management and has decided that it is time to decentraliJe the management of the subscriptions in its four regional subsidiaries. "ach subscription site 0ill handle its o0n customer and inMoice data. The company?s management/ ho0eMer/ 0ants to haMe access to customer and inMoice data to generate annual reports and to issue ad hoc .ueries/ such as1 !ist all current customers by region. !ist all ne0 customers by region. #eport all inMoices by customer and by region. $iMen these re.uirements/ ho0 must you partition the databaseN The 3c.0 USTO)(R table must be partitioned hori1ontall' b' state. .2e show the partitions in the answer to

A. $iMen the scenario and the re.uirements in 4uestion 2/ ans0er the follo0ing .uestions1 a. 8hat recommendations 0ill you ma2e regarding the type and characteristics of the re.uired database systemN The )aga1ine Publishing ompan' requires a distributed s'stem with distributed database capabilities. The distributed s'stem will be distributed among the compan' locations in South arolina" 4eorgia" 5lorida" and Tennessee. The DD%)S must be able to support distributed transparenc' !eatures" such as !ragmentation transparenc'" replica transparenc'" transaction transparenc'" and per!ormance transparenc'. +eterogeneous capabilit' is not a mandator' !eature since we assume there is no e/isting D%)S in place and that the compan' wants to standardi1e on a single D%)S. b. 8hat type of data fragmentation is needed for each tableN The database must be hori1ontall' partitioned" using the ST$T( attribute !or the USTO)(R table and the R(4*ON attribute !or the *N6O* ( table. c. 8hat must be the criteria used to partition each databaseN The !ollowing !ragmentation segments re!lect the criteria used to partition each database, 9oriJontal Fragmentation of the C(ST&M"# Table by State Fragment %ame 7 : 3 ; !ocation Tennessee 4eorgia 5lorida South arolina Condition US#ST$T( 8 9TN9 US#ST$T( 8 94$9 US#ST$T( 8 95L9 US#ST$T( 8 9S 9 %ode name N$S $TL T$) +$

9oriJontal Fragmentation of the '%+&'C" Table by #egion Fragment %ame *7 *: *3 *; !ocation Tennessee 4eorgia 5lorida South arolina Condition R(4*ON# OD( 8 9TN9 R(4*ON# OD( 8 94$9 R(4*ON# OD( 8 95L9 R(4*ON# OD( 8 9S 9 %ode name N$S $TL T$) +$

d. Design the database fragments. Sho0 an e3ample 0ith node names/ location/ fragment names/ attribute names/ and demonstration data. Note the !ollowing !ragments, Fragment C1
C(S*%(M 7<==; 7<??3 C(S*% M" >ames D. %urger Lisa %. %arnette

!ocation1 Tennessee
C(S* DD#"SS 7:3 ourt $&enue ?7< (agle Street C(S*C'TK )emphis Nash&ille

%ode1 % S
C(S*ST T" TN TN C(S*S(B*D T" =-D( -77 7:-)$R-7:

Fragment C2
C(S*%(M 77==@ 73AA= C(S*% M" 4inn' (. Stratton $nna +. $riona

!ocation1 $eorgia
C(S* DD#"SS 33A )ain Street BA@ )ason $&e. C(S*C'TK $tlanta Dalton

%ode1 T!
C(S*ST T" 4$ 4$ C(S*S(B*D T" 77-$U4-77 :3->UN-7:

Fragment CA
C(S*%(M 7<<7; 7A??= C(S*% M" >ohn T. hi Lisa %. %arnette

!ocation1 Florida
C(S* DD#"SS ;AB %rent $&enue :3; Ramala Street C(S*C'TK )iami Tampa

%ode1 T M
C(S*ST T" 5L 5L C(S*S(B*D T" 7=-NO6-77 :3-)$R-7:

Fragment CH
C(S*%(M :7AB: 7=@@B C(S*% M" Thomas 5. )atto )ar' %. Smith

!ocation1 South Carolina


C(S* DD#"SS ;A N. Pratt ircle A:B %oone PiCe C(S*C'TK harleston harleston

%ode1 C9
C(S*ST T" S S C(S*S(B*D T" :-D( -77 :=-O T-7:

Fragment '1
'%+*%(M :733;: :<??=@

!ocation1 Tennessee
#"$'&%*C&D" TN TN C(S*%(M 7<==; 7<??3 '%+*D T" 7-NO6-77 7A-5(%-7:

%ode1 % S
'%+*T&T ! ;A.?A ;A.?A

Fragment '2
'%+*%(M 7?==?3 ::;3;A

!ocation1 $eorgia
#"$'&%*C&D" 4$ 4$ C(S*%(M 77==@ 73AA= '%+*D T" 7A-$U4-77 7->UN-7:

%ode1 T!
'%+*T&T ! @<.;A ;A.?A

Fragment 'A
'%+*%(M :<<?7A :377;=

!ocation1 Florida
#"$'&%*C&D" 5L 5L C(S*%(M 7<<7; 7A??= '%+*D T" 7-NO6-77 7-)$R-7:

%ode1 T M
'%+*T&T ! ;A.?A :;.?A

Fragment 'H
'%+*%(M :;337: :377AB

!ocation1 South Carolina


#"$'&%*C&D" S S C(S*%(M :7AB: 7=@@B '%+*D T" 7A-NO6-77 7-O T-7:

%ode1 C9
'%+*T&T ! ;A.?A ;A.?A

e. 8hat type of distributed database operations must be supported at each remote siteN To answer this question" 'ou must !irst draw a map o! the locations" the !ragments at each location" and the t'pe o! transaction or request support required to access the data in the distributed database. %ode Fragment USTO)(R *N6O* ( Distributed Operations Required % S 7 *7 none T! : *: none T M 3 *3 none C9 ; *; none distributed request 9ead.uarters

4i&en the problem9s speci!ications" 'ou conclude that no interstate access o! USTO)(R or *N6O* ( data is required. There!ore" no distributed database access is required in the !our nodes. 5or the headquarters" the manager wants to be able to access the data in all !our nodes through a single SQL request. There!ore" the DD%)S must support distributed requests. f. 8hat type of distributed database operations must be supported at the head.uarters siteN See the answer !or part e.

You might also like