DDS Lecture 2

download DDS Lecture 2

of 38

Transcript of DDS Lecture 2

  • 8/18/2019 DDS Lecture 2

    1/38

    Distributed DatabaseSystemsLECTURE No 2

    Chapter 1: Introduction

    Reference: Principles of Distributed Database Systems (2ndEdition) by M. Tamer Osu! Patric" #aldusie.

    http://www.add9band.com/aa.php?isbn=ISBN:1441988335&name=Pincip!es"o#"$istib%ted"$a

    tabase"Sstems

    $

  • 8/18/2019 DDS Lecture 2

    2/38

    Lecture Pan

    % Data &ndependence and DistributedData Processin'

    % Denition of Distributed databases

    % Promises*d+anta'es of DistributedDatabases

    % Tec,nical Problems to be Studied

    2

  • 8/18/2019 DDS Lecture 2

    3/38

  • 8/18/2019 DDS Lecture 2

    4/38

    %Data Independence%% T,e de+elopment of D&'S heped to

    (uy achie#e data independence)transparency*

    % Pro+ide centrai+ed and controed datamaintenance and access

    % *pplication is immune to p,ysical and

    lo'ical le or'aniation

    /

  • 8/18/2019 DDS Lecture 2

    5/38

    %Data Independence%

    % Distributed database system is t,e union of -,atappear to be t-o diametrically opposed approac,esto data processin': database systems andcomputer net,or- 

    ! Computer net,or-s promote a mode o( ,or-that "oes a"ainst centrai+ation

    % 0ey issues to understand t,is combination

    ! The most important ob.ecti#e o( D&technoo"y is inte"ration not centrai+ation

    ! Inte"ration is possibe ,ithout centrai+ation/i0e0/ inte"ration o( databases and net-or"in'does not mean centraliation (in fact 1uite opposite)

  • 8/18/2019 DDS Lecture 2

    6/38

    %Data Independence

    • 3oal of distributed databasesystems: ac,ie+e data inte'rationand data distribution transparency

    4

  • 8/18/2019 DDS Lecture 2

    7/38

    Distributed Computin"DataProcessin"00

    • * distributed computin" system is a coection o(autonomous processin" eements t,at areinterconnected by a computer net-or". T,e elementscooperate in order to perform t,e assi'ned tas".

    •  T,e term 5distributed6 is +ery broadly used. T,e e7actmeanin' of t,e -ord depends on t,e conte7t.

    % Synonymous terms:

    ! distributed (unction

    ! distributed data processin"

    ! mutiprocessorsmuticomputers

    ! sateite processin"! bac-$end processin"

    ! dedicatedspecia purpose computers

    ! timeshared systems

    ! (unctionay moduar systems8

  • 8/18/2019 DDS Lecture 2

    8/38

    00Distributed Computin"DataProcessin"00

    9,at can be distributed! Processin" o"ic

    ! unctions

    ! Data

    ! Contro

    % ;lassication of distributed systems -it, respect to +arious criteria

    ! De"ree o( coupin"/ i0e0/ ho, cosey the processin"eements are connected

      e.'.! measured as ratio of amount of data e7c,an'ed to amount oflocal processin'

      -ea" couplin'! stron' couplin'

    ! Interconnection structure

      point

  • 8/18/2019 DDS Lecture 2

    9/38

    De3nition o( DD& and DD&'S%

    % * distributed database )DD&* is a coection o( mutipe/

    o"icay interreated databases distributed o+er a computernet-or"

    % * distributed database mana"ement system )DD&'S* is theso(t,are that mana"es

      t,e DD> and pro+ides an access mec,anism t,at ma"es t,is

    distribution transparentto t,e users.

    % T,e terms DD>MS and DD>S are often used interc,an'eably

    % &mplicit assumptions

    ! Data stored at a number o( sites each site o"icay

    consists o( a sin"e processor! Processors at di4erent sites are interconnected by acomputer net,or- ),e do

    not consider multiprocessors in DD>MS! cf. parallel systems)

    ! DD&S is a database/ not a coection o( 3es )c(0 reationadata mode*0

    Pacement and 1uery of data is impacted by t,e access ?

  • 8/18/2019 DDS Lecture 2

    10/38

    00De3nition o( DD& andDD&'S00

    $@

  • 8/18/2019 DDS Lecture 2

    11/38

    00De3nition o( DD& andDD&'S

    • E5ampe: Database consists o( 6reations empoyees/ pro.ects/and

    • assi'nment -,ic, are partitionedand stored at diAerent sites(fra'mentation).

    $$

  • 8/18/2019 DDS Lecture 2

    12/38

    7hat is not DD&S8000

    •  T,e follo-in' systems are paralleldatabase systems and are 1uitediAerent from (t,ou',

      related to) distributed D> systems

    Shared'emory

    $2

  • 8/18/2019 DDS Lecture 2

    13/38

    %7hat is not DD&S8000

    SharedDis- 

    $

  • 8/18/2019 DDS Lecture 2

    14/38

    %7hat is not DD&S8000

    SharedNothin"

    $/

  • 8/18/2019 DDS Lecture 2

    15/38

  • 8/18/2019 DDS Lecture 2

    16/38

    DD& 9ppications

    • Manufacturin'! especially multi

  • 8/18/2019 DDS Lecture 2

    17/38

    9d#anta"es o( DistributedDatabases00

    i"her reiabiity

    % Replication of components

    % Co sin'le points of failure

    % e.'.! a bro"en communication lin" orprocessin' element does not brin' do-n t,eentire system

    % Distributed transaction processin''uarantees t,e consistency of t,e databaseand concurrency

      DD>

    $8

  • 8/18/2019 DDS Lecture 2

    18/38

    009d#anta"es o( DistributedDatabases00

    • Impro#ed per(ormance

    % Pro7imity of data to its points of use

    ! Reduces remote access deays

    ! Re;uires some support (or (ra"mentation and repication

    % Parallelism in e7ecution! Inter$;uery paraeism

    ! Intra$;uery paraeism

    % pdate and read

  • 8/18/2019 DDS Lecture 2

    19/38

    009d#anta"es o( DistributedDatabases00

    Easier system e5pansion

    % &ssue is database scalin'

    % Emer'ence of microprocessor and -or"station

    tec,nolo'ies! Net,or- o( ,or-stations much cheaperthan a

    sin"e main(rame computer

    % Data communication cost +ersustelecommunication cost

    % &ncreasin' database sie

    $?

  • 8/18/2019 DDS Lecture 2

    20/38

    009d#anta"es o( DistributedDatabases00

    Transparency

    % Refers to t,e separation of t,e ,i',er

  • 8/18/2019 DDS Lecture 2

    21/38

    009d#anta"es o( DistributedDatabases00

    ser -ants to see one database Pro'rammer sees many databases

    2$

  • 8/18/2019 DDS Lecture 2

    22/38

    009d#anta"es o( DistributedDatabases00

    #arious forms of transparency can be distin"usihed (or

    DD&'Ss:

    % Cet-or" transparency (also called distributiontransparency)

    ! Location transparency! Namin" transparency

    % Replication transparency

    % Fra'mentation transparency

    % Transaction transparency! Concurrency transparency

    ! aiure transparency

    % Performance transparency

    22

  • 8/18/2019 DDS Lecture 2

    23/38

    009d#anta"es o( DistributedDatabases00

    % Net,or-Distribution transparency ao,s a userto percei#e a DD&S as a sin"e/ lo'ical entity

    % T,e user is protected from t,e operational details of t,e

    net-or" (or e+en does not "no- about t,e e7istence of

    t,e net-or")% T,e user does not need to "no- t,e location of data

    items and a command used to perform a tas" is

    independent from t,e location of t,e data and t,e sitet,e tas" is performed (ocation transparency*

    % * uni1ue name is pro+ided for eac, obGect in t,edatabase (namin" transparency*

    ! In absence o( this/ users are re;uired to embedthe ocation name as part o( an identier

    2

  • 8/18/2019 DDS Lecture 2

    24/38

    009d#anta"es o( DistributedDatabases00

    DiAerent -ays to ensure namin' transparency:

    % Solution $: ;reate a central name ser+erH ,o-e+er! t,is results in

    ! oss o( some oca autonomy

    ! centra site may become a bottenec- 

    ! o, a#aiabiity )i( the centra site (ais remainin" sites cannot createne, ob.ects*

    % Solution 2: Pre7 obGect -it, identier of site t,at created it

    ! e0"0/ branch created at site S1 mi"ht be named S10&R9NC

    ! 9so need to identi(y each (ra"ment and its copies

    ! e0"0/ copy 2 o( (ra"ment 6 o( &ranch created at site S1 mi"ht bere(erred to as

    S$.>R*C;B.F.;2

    % *n approac, t,at resol+es t,ese problems uses aliases for eac, databaseobGect

    ! Thus/ S10&R9NC060C2 mi"ht be -no,n as oca branch by user atsite S1

    ! DD&'S has tas- o( mappin" an aias to appropriate database ob.ect

    2/

  • 8/18/2019 DDS Lecture 2

    25/38

    009d#anta"es o( DistributedDatabases00

    Repication transparency ensures that theuser is

    not in#o#ed in the mana"ement o( copies ofsome

    data

    % T,e user s,ould e+en not be a-are about t,ee7istence of replicas! rat,er s,ould -or" as ift,ere e7ists a sin'le copy of t,e data

    % Replication of data is needed for +arious reasons

    ! e0"0/ increased e

  • 8/18/2019 DDS Lecture 2

    26/38

    009d#anta"es o( DistributedDatabases00

    % ra"mentation transparency ensures that the user is nota,are o(

    and is not in#o#ed in t,e fra'mentation of t,e data

    % T,e user is not in+ol+ed in ndin' 1uery processin' strate'ies o+er

    fra'ments or formulatin' 1ueries o+er fra'ments

    ! The e#auation o( a ;uery that is speci3ed o#er an entirereation but no, has to be performed on top of t,e fra'mentsre1uires an appropriate 1uery e+aluation strate'y

    % Fra'mentation is commonly done for reasons of performance!a+ailability! and reliability

    % T-o fra'mentation alternati+es

    ! ori+onta (ra"mentation: di#ide a reation into a subsetso( tupes

    ! =ertica (ra"mentation: di#ide a reation by coumns

    24

  • 8/18/2019 DDS Lecture 2

    27/38

    009d#anta"es o( DistributedDatabases00

    • Transaction transparency ensures that adistributed transactions maintain inte"rity andconsistency of t,e DD> and support concurrency

    % Eac, distributed transaction is di+ided into a number

    of sub

  • 8/18/2019 DDS Lecture 2

    28/38

    009d#anta"es o( DistributedDatabases00

    % Concurrency transparency "uarantees that transactions must e5ecute independentyand are lo'ically consistent! i.e.! e7ecutin' a set of transactions in parallel 'i+es t,e same resultas if t,e transactions -ere e7ecuted in some arbitrary serial order.

    % Same fundamental principles as for centralied D>MS! but more complicated to realie:

    ! DD&'S must ensure that "oba and oca transactions do not inter(ere ,ith each

      ot,er

    ! DD&'S must ensure consistency o( a sub$transactions o( "oba transaction

    % Replication ma"es concurrency e+en more complicated

    ! I( a copy o( a repicated data item is updated/ update must be propa"ated to acopies

    ! >ption 1: Propa"ate chan"es as part o( ori"ina transaction/ ma-in" it an atomic

      operationH ,o-e+er! if one site ,oldin' a copy is not reac,able! t,en t,e transaction is

      delayed until t,e site is reac,able.! >ption 2: Limit update propa"ation to ony those sites currenty a#aiabe?remainin"

      sites are updated -,en t,ey become a+ailable a'ain.

    ! >ption 6: 9o, updates to copies to happen asynchronousy/ sometime a(ter the

      ori'inal updateH delay in re'ainin' consistency may ran'e from a fe- seconds to

      se+eral ,ours

    2=

  • 8/18/2019 DDS Lecture 2

    29/38

    009d#anta"es o( DistributedDatabases00

    aiure transparency: DD&'S must ensure

    atomicity and durabiity o( the "oba transaction!i.e.!

    t,e sub

  • 8/18/2019 DDS Lecture 2

    30/38

    009d#anta"es o( DistributedDatabases00

    Per(ormance transparency: DD&'S must per(orm as i( it ,ere a centrai+edD&'S

    ! DD&'S shoud not su4er any per(ormance de"radation due to thedistributed

      arc,itecture

    ! DD&'S shoud determine most cost$e4ecti#e strate"y to e5ecute a

    re;uest% Distributed Iuery Processor (DIP) maps data re1uest into an ordered se1uence of 

      operations on local databases

    % DIP must consider fra'mentation! replication! and allocation sc,emas

    % DIP ,as to decide:

    ! ,hich (ra"ment to access

    ! ,hich copy o( a (ra"ment to use

    ! ,hich ocation to use

    % DIP produces e7ecution strate'y optimied -it, respect to some cost function

    % Typically! costs associated -it, a distributed re1uest include: &O cost! ;P cost! and

      communication cost

    @

  • 8/18/2019 DDS Lecture 2

    31/38

    Compicatin"actorsDisad#anta"es o( DDS

    • Compe5ity

    % Cost: Distributed systems re1uire additional ,ard-are(communication mec,anisms etc)! t,us increase,ard-are cost.

    % Security: in DDS a net-or" is in+ol+ed -,ic, is amedium t,at ,as its o-n security re1uirements. Somaintainin' a security o+er net-or" is diJcult rat,ert,en a centralied location.

    @ Inte"rity contro more di

  • 8/18/2019 DDS Lecture 2

    32/38

    Technica Probems to bestudied

    % Distributed database desi"n

    K Bo- to fra'ment t,e data

    K Partitioned data +s. replicated data

    @ Distributed ;uery processin"

    K Desi'n al'orit,ms t,at analye 1ueries and con+ert t,em into a series of data

    manipulation operations

    K Distribution of data! communication costs! etc. ,as to be considered

    K Find optimal 1uery plans

    @ Distributed directory mana"ement

    % Distributed concurrency contro

    K Sync,roniation of concurrent accesses suc, t,at t,e inte'rity of t,e D> is

    maintained

    K &nte'rity of multiple copies of (parts of) t,e D> ,a+e to be considered (mutual

    consistency)

    % Distributed deadoc- mana"ement

    K Deadloc" mana'ement: pre+ention! a+oidance! detectionreco+ery

    2

  • 8/18/2019 DDS Lecture 2

    33/38

  • 8/18/2019 DDS Lecture 2

    34/38

    ome 7or- 

    • Chapter 2: >#er#ie, o( Reationa D&'S – RD>MS concepts

     – Cormaliation

     – &nte'rity Rules

     – SIL Iueries

    • Chapter 6: Re#ie, o( Computer Net,or-s – Data ;ommunication concepts

     – Types of Cet-or"s

     –

    Protocol Standards – >road >and Cet-or"s

     – 9ireless Cet-or"

     – &nternet

    /

  • 8/18/2019 DDS Lecture 2

    35/38

    9ssi"nment No 1 DDS

    9ssi"nment No 1: Distributed Databases ;lass: >S 8t, ;PS

    Date of Submission: $8t,

     Sep 2@$2 Time of submission: $$:@ *M  Mar"s: $@

    'he p%pose o# this assi)nment is to )i*e o% hands on pactice. It is e+pected that st%dentswi!! so!*e

    the assi)nments themse!*es. ,o!!owin) %!es wi!! app! d%in) the e*a!%ation o# assi)nment.

    -heatin) #om an so%ce wi!! es%!t in eo mas in the assi)nment.

     0n st%dent #o%nd cheatin) in an o# the two assi)nments s%bmitted wi!! be awaded ,)ade in the

    co%se.

    No assi)nment a#te d%e date/time wi!! be accepted

    A 1* oo,in" is a ist o( di4erent database appications0 7hich o( the/ centrai+edor distributed/

    database architecture ,oud you recommend (or each and ,hy8

    a$ The in(ormation system o( a particuar hospita in a city

    b$ The in(ormation system o( a &an- )i-e 9&L/'C&/ &an- 9(aah etc*

    N>TE : usti(y your ans,er ,ith e5ampe

  • 8/18/2019 DDS Lecture 2

    36/38

    9ssi"nment No 2 DDS

    9ssi"nment No 2: Distributed Databases ;lass: >S 8t, 

    Shared memory #s0 'essa"e passin"

    Date of Submission: $?t, Sep 2@$2 Time of submission: $$:@ *M

      Mar"s: $@

     

    Shared memory allo-s multiple processes to read and -rite data from t,e same location.

    'essa"e passin" is anot,er -ay for processes to communicate: eac, process can send messa'es

    to ot,er processes.

     

    A 1: 'a-e a comparison bet,een shared memory and messa"e passin": ,here are theydi4erent and

    ,here are the simiar8 ou mi"ht consider di4erent modes o( messa"e passin"/ (or e5ampe,ith or

    ,ithout messa"e oss0

     

    A2: Consider the actions described beo,/ in ,hich mode )shared memory or messa"e passin"*can you best

    describe them8 7hy and ho,8

    $. ;ommunication +ia postcard

    2. Spea"in' in a room -it, t-o people

    . &nstant messa'es +ia S"ype (data remains on client if partner is oine)

    /. Spea"in' in a room full of people

    4

  • 8/18/2019 DDS Lecture 2

    37/38

    9ssi"nment No 6 DDS9ssi"nment No 6: Distributed Databases ;lass: >S 8t, ;PS

    Date of Submission: @$st October 2@$2 Time of submission: 2:@ pm

      Mar"s: @

     

    'he p%pose o# this assi)nment is to )i*e o% hands on pactice. It is e+pected that st%dents wi!! so!*e the assi)nments themse!*es.,o!!owin) %!es wi!! app!

    d%in) the e*a!%ation o# assi)nment.

    • -heatin) #om an so%ce wi!! es%!t in eo mas in the assi)nment.

    • 0n st%dent #o%nd cheatin) in an o# the thee assi)nments s%bmitted wi!! be awaded , )ade in the co%se.

    • No assi)nment a#te d%e date/time wi!! be accepted

    • 2ne )o%p o# st%dents cannot wo with same Poect 'it!e !ie the othe )o%p.

    • 0 )o%p consists o# 5 st%dents.

     Desi"n a database o( your o,n choice )i-e any or"ani+ation/ ospita/ &usiness 3rm/ Education/ onine ban-in"/

    Transaction mana"ement/ N>/ Post

    >

  • 8/18/2019 DDS Lecture 2

    38/38

    9ssi"nment No 1Compier

    9ssi"nment No 1: Compier Construction ;lass: >S 8t, ;PS

    Date of Submission: $8t, Sep 2@$2 Time of submission: $@:@@ *M

      Mar"s: $@

     

    'he p%pose o# this assi)nment is to )i*e o% hands on pactice. It is e+pected that

    st%dents wi!! so!*e the assi)nments themse!*es. ,o!!owin) %!es wi!! app! d%in) the

    e*a!%ation o# assi)nment.

    • -heatin) #om an so%ce wi!! es%!t in eo mas in the assi)nment.

    • 0n st%dent #o%nd cheatin) in an o# the two assi)nments s%bmitted wi!! beawaded , )ade in the co%se.

    • No assi)nment a#te d%e date/time wi!! be accepted

    A 1* o, a Three$Pass Compier ,or-s8A2* 7hat is the di4erence bet,een T,o$Pass Compier and Three$Pass

    Compier8 7hich compier )T,o$Pass or Three$Pass* is mosty used inthese days8

    =