Database System Architectures
Centralized Systems
Centralized database systems are those that run on a single computer
system and do not interact with other computer systems.
7/24/2017 3Md. Golam Moazzam, Dept. of CSE, JU
Database System Architectures
CentralizedSystems
Single-usersystemisadesktopunitusedbyasingleperson,
usuallywithonlyoneprocessorandoneortwoharddisks,
andusuallyonlyonepersonusingthemachineatatime.
Personalcomputersandworkstationsfallintothefirst
category.
Multiusersystemhasmoredisksandmorememory,may
havemultipleCPUsandhasamultiuseroperatingsystem.It
servesalargenumberofuserswhoareconnectedtothe
systemviaterminals.
7/24/2017 4Md. Golam Moazzam, Dept. of CSE, JU
Database System Architectures
CentralizedSystems
Thesesystemshavecoarse-granularityparallelism.Databases
runningonsuchmachinesusuallydonotattempttopartitionasingle
queryamongtheprocessors;instead,theyruneachqueryonasingle
processor,allowingmultiplequeriestorunconcurrently.Thus,such
systemssupportahigherthroughput;thatis,theyallowagreater
numberoftransactionstorunpersecond,althoughindividual
transactionsdonotrunanyfaster.
Machineswithfine-granularityparallelismhavealargenumberof
processors,anddatabasesystemsrunningonsuchmachinesattempt
toparallelizesingletasks(queries,forexample)submittedbyusers.
7/24/2017 5Md. Golam Moazzam, Dept. of CSE, JU
Database System Architectures
Client–Server Systems
Database functionality can be broadly divided into two parts:
Front end and
Back end.
7/24/2017 6Md. Golam Moazzam, Dept. of CSE, JU
Database System Architectures
Client–Server Systems
The back endmanages access structures, query evaluation
and optimization, concurrency control, and recovery.
The front endconsists of tools such as forms, report writers,
and graphical user interface facilities.
The interfacebetween the front end and the back end is
through SQL, or through an application program. Standards
such as ODBC and JDBC, were developed to interface clients
with servers.
7/24/2017 7Md. Golam Moazzam, Dept. of CSE, JU
Database System Architectures
Server System Architectures
Server systems can be broadly categorized as:
–Transaction servers and
–Data servers.
7/24/2017 8Md. Golam Moazzam, Dept. of CSE, JU
TransactionServerSystem
-Alsocalledquery-serversystemsprovideaninterfacetowhichclients
cansendrequeststoperformanaction,inresponsetowhichthey
executetheactionandsendbackresultstotheclient.Usually,client
machinesshiptransactionstotheserversystems,wherethose
transactionsareexecuted,andresultsareshippedbacktoclientsthat
areinchargeofdisplayingthedata.
Database System Architectures
7/24/2017 9Md. Golam Moazzam, Dept. of CSE, JU
Transaction Server System
A typical transaction-server system today consists of multiple
processes accessing data in shared memory.
Database System Architectures
7/24/2017 10Md. Golam Moazzam, Dept. of CSE, JU
TransactionServerSystem
Serverprocesses:Theseareprocessesthatreceiveuser
queries(transactions),executethem,andsendtheresults
back.
Lockmanagerprocess:Thisprocessimplementslock
managerfunctionality,whichincludeslockgrant,lock
release,anddeadlockdetection.
Databasewriterprocess:Thereareoneormoreprocesses
thatoutputmodifiedbufferblocksbacktodiskona
continuousbasis.
Database System Architectures
7/24/2017 11Md. Golam Moazzam, Dept. of CSE, JU
TransactionServerSystem
Logwriterprocess:Thisprocessoutputslogrecordsfrom
thelogrecordbuffertostablestorage.
Checkpointprocess:Thisprocessperformsperiodic
checkpoints.Itconsultslogtodeterminethosetransactions
thatneedtoredoneorundone.
Processmonitorprocess:Thisprocessmonitorsother
processes,andifanyofthemfails,ittakesrecoveryactions
fortheprocess.
Database System Architectures
7/24/2017 12Md. Golam Moazzam, Dept. of CSE, JU
Data-serversystems
-Allowclientstointeractwiththeserversbymakingrequeststo
readorupdatedata,inunitssuchasfilesorpages.Dataserver
systemssupplyrawdatatoclients.Suchsystemsstrivetominimize
communicationbetweenclientsandserversbycachingdataand
locksattheclients.Dataserversfordatabasesystemsoffermuch
morefunctionality;theysupportunitsofdata—suchaspages,tuples,
orobjects—thataresmallerthanafile.Theyprovideindexing
facilitiesfordata,andprovidetransactionfacilitiessothatthedata
areneverleftinaninconsistentstateifaclientmachineorprocess
fails.Data-serversystemsareusedinlocal-areanetworks,where
thereisahigh-speedconnectionbetweentheclientsandtheserver.
Database System Architectures
7/24/2017 13Md. Golam Moazzam, Dept. of CSE, JU
Computer System Architecture
Computer system architectures consisting of interconnected
multiple processors are basically classified into two different
categories:
•Tightly coupled system and
•Loosely coupled system.
Database System Architectures
7/24/2017 14Md. Golam Moazzam, Dept. of CSE, JU
TightlyCoupledSystem
Thereisasinglesystemwideglobalprimarymemorythatisshared
byprocessorsconnectedtothesystem.Ifanyprocessorwritessome
informationintheglobalmemory,itcanbesharedbyallother
processors.Forexample,ifaprocessorwritesthevalue200toa
memorylocationy,anyotherprocessorsreadingfromthelocationy
willgetthevalue200.Inthissystem,communicationtakesplace
throughsharedmemory.
Communication Network
CPU
1
CPU
2 CPU
3
CPU
4
System wide
shared global
memory
Fig. A Tightly coupled multiprocessor system
Also called parallel processing system.
Database System Architectures
7/24/2017 15Md. Golam Moazzam, Dept. of CSE, JU
LooselyCoupledSystem
Processorsdon‘tsharememory.Eachprocessorhasitsownlocal
memory.Ifaprocessorwritesavalue200toamemorylocationy,it
onlychangesthecontentofitsownlocalmemoryanddoesnot
affectthecontentofthememoryofanyotherprocessors.Inthis
system,communicationsareestablishedbypassingmessagesacross
thenetwork.
Also called distributed system.
Communication Network
CPU
1
Fig. A Loosely coupled multiprocessor system
Local memory
CPU
2
Local memory
CPU
n
Local memory
Database System Architectures
7/24/2017 16Md. Golam Moazzam, Dept. of CSE, JU
Parallel Processing Systems
A parallel processing system involves multiple processes that are active
simultaneously and solving a given problem, generally on multiple
processors. It divides a large task into several subtasks and executes
these subtasks concurrently on several processors.
Characteristics
•Parallel systems improve processing and I/O speeds by using multiple
CPUs and disks in parallel.
•All processors in the system can perform their tasks concurrently.
•Tasks need to be synchronized.
•Processors usually share resources such as data, disks, and other
devices.
•Parallel computers with hundreds of CPUs and disks are available
commercially.
•Parallel system improves the system performance in terms of two
important properties: Speedupand Scaleup.
Database System Architectures
7/24/2017 17Md. Golam Moazzam, Dept. of CSE, JU
Speedup
•Running a given task in less time by increasing the degree of
parallelism is called speedup.
•Suppose that the execution time of a task on a larger machine is
T
L.The execution time of the same task on a smaller machine is
T
S. Thus, Speedup= T
S/T
L.
•If the speedup is N when the larger system has N times the
resources (processors, disk, and so on) of the smaller system,
the system is said to demonstrate linear speedup. If the
speedup is less than N, the system is said to demonstrate
sublinearspeedup.
Database System Architectures
7/24/2017 18Md. Golam Moazzam, Dept. of CSE, JU
Scaleup
•Handling larger tasks by increasing the degree of parallelism is
called scaleup.
•Let Q be a task, and let Q
Nbe another task that is N times
bigger than Q. Suppose the execution time of task Q on a
smaller machine M
Sis T
S, and the execution time of task Q
Non
a parallel machine M
Lis T
L. Thus, scaleup= T
S/T
L
•The parallel system M
Lis said to demonstrate linear scaleupon
task Q if T
L= T
S. If T
L> T
S, the system is said to demonstrate
sublinearscaleup
Database System Architectures
7/24/2017 19Md. Golam Moazzam, Dept. of CSE, JU
What is a Distributed Database System?
We define a distributed database as a collection of multiple,
logically interrelated databases distributed over a computer
network. A distributed database management system
(distributed DBMS) is then defined as the software system
that permits the management of the distributed database and
makes the distribution transparent to the users.
A DDBS is not a ―collection of files‖ that can be individually
stored at each node of a computer network. To form a DDBS,
files should not only be logically related, but there should be
structured among the files, and access should be via a
common interface.
Database System Architectures
7/24/2017 20Md. Golam Moazzam, Dept. of CSE, JU
Multiprocessor systems VS DDBS ?
MultiprocessorsystemsarenotconsideredasDDBSs.
InDDBS,thecommunicationbetweennodesisdoneovera
networkinsteadofthroughsharedmemoryorshareddisk,
withthenetworkastheonlysharedresource.
Althoughshared-nothingmultiprocessors,whereeach
processornodehasitsownprimaryandsecondarymemory,
andmayalsohaveitsownperipherals,arequitesimilartothe
distributedenvironment,therearedifferences.
Database System Architectures
7/24/2017 21Md. Golam Moazzam, Dept. of CSE, JU
Multiprocessor systems VS DDBS ?
Amultiprocessorsystemdesignissymmetrical,consistingof
anumberofidenticalprocessorandmemorycomponents,
andcontrolledbyoneormorecopiesofthesameoperating
systemthatisresponsibleforastrictcontrolofthetask
assignmenttoeachprocessor.Thisisnottrueindistributed
computingsystems,whereheterogeneityoftheoperating
systemaswellasthehardwareisquitecommon.
Databasesystemsthatrunovermultiprocessorsystemsare
calledparalleldatabasesystems.
Database System Architectures
7/24/2017 22Md. Golam Moazzam, Dept. of CSE, JU
What is Distributed Data Processing or distributed
computing system?
Adistributedcomputingsystemstatesthatitisanumberof
autonomousprocessingelements(notnecessarily
homogeneous)thatareinterconnectedbyacomputernetwork
andthatcooperateinperformingtheirassignedtasks.
Database System Architectures
7/24/2017 23Md. Golam Moazzam, Dept. of CSE, JU
Distributed Database Management System
•Consists of a single logical database that is split into a number
of fragments. Each fragment is stored on one or more
computers.
•The computers in a distributed system communicate with one
another through various communication media, such as high-
speed networks or telephone lines.
•They do not share main memory or disks.
•Each site is capable of independently processing user requests
that require access to local data as well as it is capable of
processing user requests that require access to remote data
stored on other computers in the network.
The general structure of a distributed system appears in the following
figure.
Database System Architectures
7/24/2017 24Md. Golam Moazzam, Dept. of CSE, JU
Distributed Database Management System
The general structure of a distributed system appears in the following figure.
Database System Architectures
7/24/2017 25Md. Golam Moazzam, Dept. of CSE, JU
DistributedDatabaseManagementSystem
•Alocaltransactionisonethataccessesdataonlyfrom
siteswherethetransactionwasinitiated.
•Aglobaltransaction,ontheotherhand,isonethat
eitheraccessesdatainasitedifferentfromtheoneat
whichthetransactionwasinitiated,oraccessesdatain
severaldifferentsites.
Database System Architectures
7/24/2017 26Md. Golam Moazzam, Dept. of CSE, JU
PromisesofDDBSs
ManyadvantagesofDDBSshavebeencitedinliterature,
rangingfromsociologicalreasonsfordecentralizationtobetter
economics.Allofthesecanbedistilledtofourfundamentals
whichmayalsobeviewedaspromisesofDDBStechnology:
Transparentmanagementofdistributedandreplicated
data.
Reliableaccesstodatathroughdistributedtransactions
Improvedperformanceand
Easiersystemexpansion.
Database System Architectures
7/24/2017 27Md. Golam Moazzam, Dept. of CSE, JU
PromisesofDDBSs
TransparentManagementofDistributedandReplicated
Data
Transparencyreferstoseparationofthehigher-level
semanticsofasystemfromlower-levelimplementation
issues.
Inotherwords,atransparentsystem―hides‖the
implementationdetailsfromusers.
TheadvantageofafullytransparentDBMSisthehighlevel
ofsupportthatitprovidesforthedevelopmentofcomplex
applications.
Database System Architectures
7/24/2017 28Md. Golam Moazzam, Dept. of CSE, JU
PromisesofDDBSs
ReliabilitythroughDistributedTransactions
DistributedDBMSsareintendedtoimprovereliabilitysince
theyhavereplicatedcomponentsand,therebyeliminate
singlepointsoffailure.
Thefailureofasinglesite,orthefailureofacommunication
linkwhichmakesoneormoresitesunreachable,isnot
sufficienttobringdowntheentiresystem.
Database System Architectures
7/24/2017 29Md. Golam Moazzam, Dept. of CSE, JU
PromisesofDDBSs:ImprovedPerformance
AdistributedDBMSfragmentstheconceptualdatabase,
enablingdatatobestoredincloseproximitytoitspointsof
use(alsocalleddatalocalization).Thishastwopotential
advantages:
1.Sinceeachsitehandlesonlyaportionofthedatabase,
contentionforCPUandI/Oservicesisnotassevereas
forcentralizeddatabases.
2.Localizationreducesremoteaccessdelays.
Inter-queryparallelismresultsfromtheabilitytoexecute
multiplequeriesatthesametimewhileintra-query
parallelismisachievedbybreakingupasinglequeryintoa
numberofsubquerieseachofwhichisexecutedata
differentsite,accessingadifferentpartofthedistributed
database.
Database System Architectures
7/24/2017 30Md. Golam Moazzam, Dept. of CSE, JU
PromisesofDDBSs:
EasierSystemExpansion
Inadistributedenvironment,itismucheasierto
accommodateincreasingdatabasesizes.
Expansioncanusuallybehandledbyaddingprocessingand
storagepowertothenetwork.
Obviously,itmaynotbepossibletoobtainalinearincrease
in―power,‖sincethisalsodependsontheoverheadof
distribution.
Database System Architectures
7/24/2017 31Md. Golam Moazzam, Dept. of CSE, JU
ComplicationsIntroducedbyDDBS
1.Datamaybereplicatedinadistributedenvironment.A
distributeddatabasecanbedesignedsothattheentire
database,orportionsofit,resideatdifferentsitesofa
computernetwork.
2.Ifsomesitesfailorifsomecommunicationlinksfail
whileanupdateisbeingexecuted,thesystemmustmake
surethattheeffectswillbereflectedonthedataresiding
atthefailingorunreachablesitesassoonasthesystem
canrecoverfromthefailure.
3.Theexchangeofmessagesandtheadditional
computationrequiredtoachieveinter-sitecoordination
areaformofoverheadthatdoesnotariseincentralized
systems.
Database System Architectures
7/24/2017 32Md. Golam Moazzam, Dept. of CSE, JU
ComplicationsIntroducedbyDDBS
4.AsdatainadistributedDBMSarelocatedatmultiple
sites,theprobabilityofsecuritylapsesincreases.Further,
allcommunicationsbetweendifferentsitesina
distributedDBMSareconveyedthroughthenetwork,so
theunderlyingnetworkhastobemadesecuretomaintain
systemsecurity.
5.Sinceeachsitecannothaveinstantaneousinformationon
theactionscurrentlybeingcarriedoutattheothersites,
thesynchronizationoftransactionsonmultiplesitesis
considerablyharderthanforacentralizedsystem.
Database System Architectures
7/24/2017 33Md. Golam Moazzam, Dept. of CSE, JU
WhatisbeingdistributedinDDBS?
Processinglogicorprocessingelementsaredistributed.The
―processingelement‖isacomputingdevicethatcanexecute
aprogramonitsown.
Function.Variousfunctionsofacomputersystemcouldbe
delegatedtovariouspiecesofhardwareorsoftware.
Data.Datausedbyanumberofapplicationsmaybe
distributedtoanumberofprocessingsites.
Finally,controlcanbedistributed.Thecontrolofthe
executionofvarioustasksmightbedistributedinsteadof
beingperformedbyonecomputersystem.
Database System Architectures
7/24/2017 34Md. Golam Moazzam, Dept. of CSE, JU
Classification of DDBMS
•Homogeneous and
•Heterogeneous Databases
Homogeneous Distributed Database
All sites have identical database management system software,
are aware of one another, and agree to cooperate in processing
users‘ requests.
Use same DB schemas at all sites.
Easier to design and manage
Addition of a new site is much easier.
Database System Architectures
7/24/2017 35Md. Golam Moazzam, Dept. of CSE, JU
Heterogeneous distributed database
•Usually constructed over a no. of existing sites.
•Each site has its local database. Different sites may use
different schemas (relational model, OO model etc.).
•Use different DBMS software.
•Query processing is more difficult.
•Use gateways (as query translator) which convert the language
and data model of each different DBMS into the language and
data model of the relational system.
Database System Architectures
7/24/2017 36Md. Golam Moazzam, Dept. of CSE, JU
Data Storage in DDBMS
Replication. The system maintains several identical replicas
(copies) of the relation, and stores each replica at a different
site.
Fragmentation. The system partitions the relation into several
fragments, and stores each fragment at a different site.
Fragmentation and replication can be combined.
Advantages and disadvantages of Replication
Availability.
Increased parallelism.
Increased overhead on update.
Database System Architectures
7/24/2017 37Md. Golam Moazzam, Dept. of CSE, JU
Data Fragmentation
If relation r is fragmented, r is divided into a number of
fragments r
1, r
2, . . . , r
n.
These fragments contain sufficient information to allow
reconstruction of the original relation r.
There are two different schemes for fragmenting a
relation:
-Horizontal fragmentationand
-Vertical fragmentation
Database System Architectures
7/24/2017 38Md. Golam Moazzam, Dept. of CSE, JU
Horizontal Fragmentation
Inhorizontalfragmentation,arelationrispartitionedintoa
numberofsubsets,r
1,r
2,...,r
n.
Eachtupleofrelationrmustbelongtoatleastoneofthe
fragments,sothattheoriginalrelationcanbereconstructed,if
needed.
As an illustration, consider the account relation:
Account-schema = (account-number, branch-name, balance)
The relation can be divided into several different fragments. If the
banking system has only two branches -Savarand Dhanmondi-then
there are two different fragments:
account
1= σ
branch-name = “Savar”(account)
account
2= σ
branch-name = “Dhanmondi”(account)
Database System Architectures
7/24/2017 39Md. Golam Moazzam, Dept. of CSE, JU
Horizontal Fragmentation
Use a predicate P
ito construct fragment r
i:
r
i= σ
Pi(r)
Reconstruct the relation r by taking the union of all
fragments. That is,
r = r
1∪r
2∪· · · ∪r
n
The fragments are disjoint.
Database System Architectures
7/24/2017 40Md. Golam Moazzam, Dept. of CSE, JU
Vertical Fragmentation
Vertical fragmentation of r(R) involves the definition of several
subsets of attributes R
1, R
2, . . .,R
nof the schema R so that
R = R
1∪R
2∪· · · ∪R
n
Each fragment r
iof r is defined by
r
i= Π
Ri(r)
We can reconstruct relation r from the fragments by taking the
natural join
r = r
1⋈r
2⋈r
3⋈· · · ⋈r
n
One way of ensuring that the relation r can be reconstructed is
to include the primary-key attributes of R in each of the R
i.
Database System Architectures
7/24/2017 41Md. Golam Moazzam, Dept. of CSE, JU
Vertical Fragmentation
-To illustrate vertical fragmentation, consider the following relation:
employee-info=(employee-id, name, designation, salary)
-Forprivacyreasons,therelationmaybefragmentedintoarelation
employee-privateinfocontainingemployee-idandsalary,andanother
relationemployee-public-infocontainingattributesemployee-id,name,
anddesignation.
employee-privateinfo=(employee-id, salary)
employee-publicinfo=(employee-id, name, designation)
-These may be stored at different sites, again for security reasons.
Database System Architectures
7/24/2017 42Md. Golam Moazzam, Dept. of CSE, JU
Correctness Rules for Data Fragmentation
To ensure no loss of information and no redundancy of data, there are
three different rules that must be considered during fragmentation.
Completeness
If a relation instance R is decomposed into fragments R
1, R
2, . . . .R
n,
each data item in R must appear in at least one of the fragments. It is
necessary in fragmentation to ensure that there is no loss of data during
data fragmentation.
Reconstruction
If relation R is decomposed into fragments R
1, R
2, . . . .R
n, it must be
possible to define a relational operation that will reconstruct the relation
R from fragments R
1, R
2, . . . .R
n. This rule ensures that constrains
defined on the data are preserved during data fragmentation.
Database System Architectures
7/24/2017 43Md. Golam Moazzam, Dept. of CSE, JU
Correctness Rules for Data Fragmentation
To ensure no loss of information and no redundancy of data, there are
three different rules that must be considered during fragmentation.
Disjointness
If a relation R is decomposed into fragments R
1, R
2, . . . .R
nand if a data
item is found in the fragment R
i, then it must not appear in any other
fragments. This rule ensures minimal data redundancy.
In case of vertical fragmentation, primary key attribute must be repeated
to allow reconstruction. Therefore, in case of vertical fragmentation,
disjointnessis defined only on non-primary key attributes of a relation.
Database System Architectures
7/24/2017 44Md. Golam Moazzam, Dept. of CSE, JU
Example
LetusconsidertherelationalschemaProjectwhereproject-type
representswhethertheprojectisaninsideprojectorabroadproject.
AssumethatP1andP2aretwohorizontalfragmentsoftherelation
Project,whichareobtainedbyusingthepredicate―whetherthevalueof
project-typeattributeis‗inside‘or‗abroad‘.
Database System Architectures
7/24/2017 45Md. Golam Moazzam, Dept. of CSE, JU
Example (Horizontal Fragmentation)
P1: σ
project-type = “inside”(Project)
P2: σ
project-type = “abroad”(Project)
Database System Architectures
7/24/2017 46Md. Golam Moazzam, Dept. of CSE, JU
Example (Horizontal Fragmentation)
Thesehorizontalfragmentssatisfyallthecorrectnessrulesof
fragmentationasshownbelow.
Completeness:EachtupleintherelationProjectappearseitherin
fragmentP1orP2.Thus,itsatisfiescompletenessrulefor
fragmentation.
Reconstruction:TheProjectrelationcanbereconstructedfromthe
horizontalfragmentsP1andP2byusingtheunionoperationof
relationalalgebra,whichensuresthereconstructionrule.
Thus,P1P2=Project.
Disjointness:ThefragmentsP1andP2aredisjoint,sincetherecanbe
nosuchprojectwhoseprojecttypeisboth―inside‖and―abroad‖.
Database System Architectures
7/24/2017 47Md. Golam Moazzam, Dept. of CSE, JU
Example (Vertical Fragmentation)
Database System Architectures
7/24/2017 48Md. Golam Moazzam, Dept. of CSE, JU
Example (Vertical Fragmentation)
Theseverticalfragmentsalsoensurethecorrectnessrulesof
fragmentationasshownbelow.
Completeness:EachtupleintherelationProjectappearseitherin
fragmentV1orV2whichsatisfiescompletenessruleforfragmentation.
Reconstruction:TheProjectrelationcanbereconstructedfromthe
verticalfragmentsV1andV2byusingthenaturaljoinoperationof
relationalalgebra,whichensuresthereconstructionrule.
Thus,V1⋈V2=Project.
Disjointness:ThefragmentsV1andV2aredisjoint,exceptforthe
primarykeyproject-id,whichisrepeatedinbothfragmentsandis
necessaryforreconstruction.
Database System Architectures
7/24/2017 49Md. Golam Moazzam, Dept. of CSE, JU
Distributed Database System Design Issues
DistributedDatabaseDesign
DistributedDirectoryManagement
DistributedQueryProcessing
DistributedConcurrencyControl
DistributedDeadlockManagement
ReliabilityofDistributedDBMS
Replication
RelationshipamongProblems
Database System Architectures
7/24/2017 50Md. Golam Moazzam, Dept. of CSE, JU
DistributedDatabaseDesign
Therearetwobasicalternativestoplacingdata:
Partitioned(ornon-replicated)and
Replicated
Inthepartitionedschemethedatabaseisdividedintoa
numberofdisjointpartitionseachofwhichisplacedata
differentsite.
Replicateddesignscanbeeitherfullyreplicated(alsocalled
fullyduplicated)wheretheentiredatabaseisstoredateach
site,orpartiallyreplicated(orpartiallyduplicated)where
eachpartitionofthedatabaseisstoredatmorethanonesite,
butnotatallthesites.
Database System Architectures
7/24/2017 51Md. Golam Moazzam, Dept. of CSE, JU
DistributedDirectoryManagement
Adirectorycontainsinformation(suchasdescriptionsand
locations)aboutdataitemsinthedatabase.
AdirectorymaybeglobaltotheentireDDBSorlocalto
eachsite;
Itcanbecentralizedatonesiteordistributedoverseveral
sites;therecanbeasinglecopyormultiplecopies.
Database System Architectures
7/24/2017 52Md. Golam Moazzam, Dept. of CSE, JU
DistributedQueryProcessing
Queryprocessingdealswithdesigningalgorithmsthat
analyzequeriesandconvertthemintoaseriesofdata
manipulationoperations.
Theproblemishowtodecideonastrategyforexecuting
eachqueryoverthenetworkinthemostcost-effectiveway.
Thefactorstobeconsideredarethedistributionofdata,
communicationcosts,andlackofsufficientlocally-available
information.
Database System Architectures
7/24/2017 53Md. Golam Moazzam, Dept. of CSE, JU
DistributedConcurrencyControl
Concurrencycontrolinvolvesthesynchronizationof
accessestothedistributeddatabase,suchthattheintegrityof
thedatabaseismaintained.
DistributedDeadlockManagement
Thecompetitionamongusersforaccesstoasetofresources
(data,inthiscase)canresultinadeadlockifthe
synchronizationmechanismisbasedonlocking.
Thewell-knownalternativesofprevention,avoidance,and
detection/recoveryalsoapplytoDDBSs.
Database System Architectures
7/24/2017 54Md. Golam Moazzam, Dept. of CSE, JU
ReliabilityofDistributedDBMS
Oneofthepotentialadvantagesofdistributedsystemsis
improvedreliabilityandavailability.This,however,isnota
featurethatcomesautomatically.
Itisimportantthatmechanismsbeprovidedtoensurethe
consistencyofthedatabaseaswellastodetectfailuresand
recoverfromthem.
Whenafailureoccursandvarioussitesbecomeeither
inoperableorinaccessible,thedatabasesattheoperational
sitesremainconsistentanduptodate.
Database System Architectures
7/24/2017 55Md. Golam Moazzam, Dept. of CSE, JU
Replication
Ifthedistributeddatabaseis(partiallyorfully)replicated,it
isnecessarytoimplementprotocolsthatensurethe
consistencyofthereplicas,
RelationshipamongProblems
Theproblemsarenotisolatedfromoneanother.Each
problemisaffectedbythesolutionsfoundfortheothers.
Therelationshipamongthecomponentsisshowninthe
followingFigure.Thedesignofdistributeddatabasesaffects
manyareas.Itaffectsdirectorymanagement,becausethe
definitionoffragmentsandtheirplacementdeterminethe
contentsofthedirectoryaswellasthestrategiesthatmaybe
employedtomanagethem.
Database System Architectures
7/24/2017 56Md. Golam Moazzam, Dept. of CSE, JU
RelationshipamongProblems
Directory
Management
Distributed
DB Design
Query
Processing
Reliability
Replication
Concurrency
Control
Deadlock
Management
Fig.: Relationship among Research Issues
Database System Architectures
7/24/2017 57Md. Golam Moazzam, Dept. of CSE, JU
RelationshipamongProblems
Thesameinformation(i.e.,fragmentstructureand
placement)isusedbythequeryprocessortodeterminethe
queryevaluationstrategy.Similarly,directoryplacementand
contentsinfluencetheprocessingofqueries.
Thereplicationoffragmentswhentheyaredistributed
affectstheconcurrencycontrolstrategiesthatmightbe
employed.
Someconcurrencycontrolalgorithmscannotbeeasilyused
withreplicateddatabases.
Database System Architectures
7/24/2017 58Md. Golam Moazzam, Dept. of CSE, JU
RelationshipamongProblems
Thereisastrongrelationshipamongtheconcurrencycontrol
problem,thedeadlockmanagementproblem,andreliability
issues.Theconcurrencycontrolalgorithmthatisemployed
willdeterminewhetherornotaseparatedeadlock
managementfacilityisrequired.Ifalocking-based
algorithmisused,deadlockswilloccur,whereastheywill
notiftimestampingisthechosenalternative.
Reliabilitymechanismsinvolvebothlocalrecovery
techniquesanddistributedreliabilityprotocols.Techniques
toprovidereliabilityalsomakeuseofdataplacement
informationsincetheexistenceofduplicatecopiesofthe
dataserveasasafeguardtomaintainreliableoperation.
Database System Architectures
7/24/2017 59Md. Golam Moazzam, Dept. of CSE, JU
RelationshipamongProblems
Finally,theneedforreplicationprotocolsariseifdata
distributioninvolvesreplicas.
Database System Architectures
7/24/2017 60Md. Golam Moazzam, Dept. of CSE, JU
Distributed Database System
Each site has autonomous processing capability and can
perform local applications.
Each site also participates in the execution of at least one
global applicationwhich requires accessing data at several
sites.
Database System Architectures
7/24/2017 61Md. Golam Moazzam, Dept. of CSE, JU
DistributedDBMSArchitecture
Thearchitectureofasystemdefinesitsstructure.Thismeans
thatthecomponentsofthesystemareidentified,thefunctionof
eachcomponentisspecified,andtheinterrelationshipsand
interactionsamongthesecomponentsaredefined.
ThreereferencearchitecturesforadistributedDBMS:
1.Client/Serversystems
2.Peer-to-PeerdistributedDBMSand
3.Multidatabasesystems.
Areferencearchitectureiscommonlycreatedbystandards
developerstoclearlydefinetheinterfacesthatneedtobe
standardized.
Database System Architectures
7/24/2017 62Md. Golam Moazzam, Dept. of CSE, JU
ANSI/SPARCArchitecture
AsimplifiedversionoftheANSI/SPARCarchitectureisdepictedin
thefollowingFigure.
Therearethreeviewsofdata:
External view, which is that of the end user,
Internal view, that of the system or machine
Conceptual view, that of the enterprise. For each of these
views, an appropriate schema definition is required.
Database System Architectures
7/24/2017 63Md. Golam Moazzam, Dept. of CSE, JU
ANSI/SPARCArchitecture
Fig.: The ANSI/SPARC Architecture
Internal
View
Conceptual
View
External
View
External
View
External
View
Users
External
Schema
Conceptual
Schema
Internal Schema
Database System Architectures
7/24/2017 64Md. Golam Moazzam, Dept. of CSE, JU
ANSI/SPARCArchitecture
Atthelowestlevelofthearchitectureistheinternalview,
whichdealswiththephysicaldefinitionandorganizationof
data.Thelocationofdataondifferentstoragedevicesandthe
accessmechanismsusedtoreachandmanipulatedataare
theissuesdealtwithatthislevel.
Attheotherextremeistheexternalview,whichisconcerned
withhowusersviewthedatabase.Anindividualuser‘sview
representstheportionofthedatabasethatwillbeaccessedby
thatuser.Aviewcanbesharedamonganumberofusers,with
thecollectionofuserviewsmakinguptheexternalschema.
Database System Architectures
7/24/2017 65Md. Golam Moazzam, Dept. of CSE, JU
ANSI/SPARCArchitecture
Inbetweenthesetwoendsistheconceptualschema,whichis
anabstractdefinitionofthedatabase.
AmericanNationalStandardsInstitute(ANSI)establisheda
StudyGrouponDatabaseManagementSystemsunderthe
auspicesofitsStandardsPlanningandRequirements
Committee(SPARC).
Database System Architectures
7/24/2017 66Md. Golam Moazzam, Dept. of CSE, JU
Distributed DBMS Architecture
Theclient/serverdistributionconcentratesdatamanagement
dutiesatserverswhiletheclientsfocusonprovidingthe
applicationenvironmentincludingtheuserinterface.
Inpeer-to-peerdistribution,thereisnodistinctionofclient
machinesversusservers.EachmachinehasfullDBMS
functionalityandcancommunicatewithothermachinesto
executequeriesandtransactions.
Database System Architectures
7/24/2017 67Md. Golam Moazzam, Dept. of CSE, JU
Peer-to-Peer Distributed Systems
Thephysicaldataorganizationoneachmachineisdifferent.
Thereneedstobeanindividualinternalschemadefinitionat
eachsite(LocalInternalSchema(LIS)).
TheenterpriseviewofthedataisdescribedbytheGlobal
ConceptualSchema(GCS)-itdescribesthelogicalstructureof
thedataatallthesites.
Datainadistributeddatabaseisusuallyfragmentedand
replicated.
Database System Architectures
7/24/2017 68Md. Golam Moazzam, Dept. of CSE, JU
Peer-to-Peer Distributed Systems
Tohandlefragmentationandreplication,thelogical
organizationofdataateachsiteneedstobedescribed.
Therefore,thereneedstobeathirdlayerinthearchitecture,the
LocalConceptualSchema(LCS).
TheGCSistheunionoftheLCSs.Userapplicationsanduser
accesstothedatabaseissupportedbyExternalSchemas(ESs)
Database System Architectures
7/24/2017 69Md. Golam Moazzam, Dept. of CSE, JU
Peer-to-Peer Distributed Systems
Fig.: Distributed Database Reference Architecture
Database System Architectures
7/24/2017 70Md. Golam Moazzam, Dept. of CSE, JU
Peer-to-Peer Distributed Systems
ThedistributedDBMStranslatesglobalqueriesintoagroupof
localqueries,whichareexecutedbydistributedDBMScomponents
atdifferentsitesthatcommunicateoneanother.
Database System Architectures
7/24/2017 71Md. Golam Moazzam, Dept. of CSE, JU
Components of a Distributed DBMS
Majortwocomponents:
UserProcessor:
Handlestheinteractionwithusersand
DataProcessor:
Dealswiththestorage.
Database System Architectures
7/24/2017 72Md. Golam Moazzam, Dept. of CSE, JU
Components of a Distributed DBMS
Database System Architectures
7/24/2017 73Md. Golam Moazzam, Dept. of CSE, JU
Components of a Distributed DBMS
ThefirstcomponentUserProcessorconsistsoffourelements:
i)Userinterfacehandler
ii)Semanticdatacontroller
iii)Globalqueryoptimizeranddecomposer
iv)Distributedexecutionmonitor
1.Theuserinterfacehandlerisresponsibleforinterpretinguser
commandsastheycomein,andformattingtheresultdataasitis
senttotheuser.
2.Thesemanticdatacontrollerusestheintegrityconstraintsand
authorizationsthataredefinedaspartoftheglobalconceptual
schematocheckiftheuserquerycanbeprocessed.
Database System Architectures
7/24/2017 74Md. Golam Moazzam, Dept. of CSE, JU
Components of a Distributed DBMS
3.Theglobalqueryoptimizeranddecomposerdeterminesan
executionstrategytominimizeacostfunction,andtranslatesthe
globalqueriesintolocalonesusingtheglobalandlocal
conceptualschemas.Theglobalqueryoptimizerisresponsible,
amongotherthings,forgeneratingthebeststrategytoexecute
distributedjoinoperations.
4.Thedistributedexecutionmonitorcoordinatesthedistributed
executionoftheuserrequest.Theexecutionmonitorisalso
calledthedistributedtransactionmanager.Inexecutingqueries
inadistributedfashion,theexecutionmonitorsatvarioussites
may,andusuallydo,communicatewithoneanother.
Database System Architectures
7/24/2017 75Md. Golam Moazzam, Dept. of CSE, JU
Components of a Distributed DBMS
ThesecondcomponentDataProcessorconsistsofthreeelements:
i)Localqueryoptimizer
ii)Localrecoverymanager
iii)Run-timesupportprocessor
Inpeer-to-peersystems,oneexpectstofindboththeuser
processormodulesandthedataprocessormodulesoneach
machine.
1.Thelocalqueryoptimizer,whichactuallyactsastheaccesspath
selector,isresponsibleforchoosingthebestaccesspathto
accessanydataitem.
Database System Architectures
7/24/2017 76Md. Golam Moazzam, Dept. of CSE, JU
Components of a Distributed DBMS
2.Thelocalrecoverymanagerisresponsibleformakingsurethat
thelocaldatabaseremainsconsistentevenwhenfailuresoccur.
3.Therun-timesupportprocessorphysicallyaccessesthedatabase
accordingtothephysicalcommandsintheschedulegenerated
bythequeryoptimizer.Therun-timesupportprocessoristhe
interfacetotheoperatingsystemandcontainsthedatabase
buffer(orcache)manager,whichisresponsibleformaintaining
themainmemorybuffersandmanagingthedataaccesses.
Database System Architectures
7/24/2017 77Md. Golam Moazzam, Dept. of CSE, JU
MultidatabaseSystem(MDBS)Architecture
Multidatabasesystems(MDBS)representthecasewhere
individualDBMSs(whetherdistributedornot)arefully
autonomousandhavenoconceptofcooperation;
Theymaynoteven―know‖ofeachother‘sexistenceorhowto
talktoeachother.
Database System Architectures
7/24/2017 78Md. Golam Moazzam, Dept. of CSE, JU
Distributedmulti-DBMSsVSdistributedDBMSs
Thefundamentaldifferencerelatestothedefinitionoftheglobal
conceptualschema.Inthecaseoflogicallyintegrateddistributed
DBMSs,theglobalconceptualschemadefinestheconceptual
viewoftheentiredatabase,whileinthecaseofdistributed
multi-DBMSs,itrepresentsonlythecollectionofsomeofthe
localdatabasesthateachlocalDBMSwantstoshare.
TheindividualDBMSsmaychoosetomakesomeoftheirdata
availableforaccessbyothersbydefininganexportschema.
Database System Architectures
7/24/2017 79Md. Golam Moazzam, Dept. of CSE, JU
Distributedmulti-DBMSsVSdistributedDBMSs
InMDBSs,theglobaldatabaseisequaltotheunionoflocal
databases,whereasindistributedDBMSsitisonlyasubsetof
thesameunion.
InaMDBS,theGCSisdefinedbyintegratingeithertheexternal
schemasoflocalautonomousdatabasesorlocalconceptual
schemas.
Database System Architectures
7/24/2017 80Md. Golam Moazzam, Dept. of CSE, JU
MDBSArchitecture
Fig.: MDBS Architecture with a GCS
LIS
1 LIS
n. . . .
LCS
1 LCS
n. . . .
LES
11LES
12LES
13 LES
n1LES
n2LES
n3
GES
1GES
2GES
3
GCS
Database System Architectures
7/24/2017 81Md. Golam Moazzam, Dept. of CSE, JU
MDBSArchitecture
UsersofalocalDBMSdefinetheirownviewsonthelocal
databaseanddonotneedtochangetheirapplicationsiftheydo
notwanttoaccessdatafromanotherdatabase.Thisisagainan
issueofautonomy.
Designingtheglobalconceptualschemainmultidatabase
systemsinvolvestheintegrationofeitherthelocalconceptual
schemasorthelocalexternalschemas.
OncetheGCShasbeendesigned,viewsovertheglobalschema
canbedefinedforuserswhorequireglobalaccess.Itisnot
necessaryfortheGESandGCStobedefinedusingthesame
datamodelandlanguage;whethertheydoornotdetermines
whetherthesystemishomogeneousorheterogeneous.
Database System Architectures
7/24/2017 82Md. Golam Moazzam, Dept. of CSE, JU
MDBSArchitecture
LISLocalInternalSchema:Physicaldataorganizationand
techniquestomanipulatedataatdifferentsites.
LCSLocalConceptualSchema:datadefinitionatdifferentsites.
LESLocalExternalSchema:Localuserdataview.
GCSGlobalConceptualSchema:UnionofLCSswhowantto
sharedata.Datadefinitionforglobalusers.
GESGlobalExternalSchema:Globaluserdataview.
Database System Architectures
7/24/2017 83Md. Golam Moazzam, Dept. of CSE, JU
Component-basedarchitecturalmodelofamulti-DBMS
DBMS
Fig.: Components of an MDBS
DBMS
Multi-DBMS Layer
. . . .
User
User
requests
System
responses
Database System Architectures
7/24/2017 84Md. Golam Moazzam, Dept. of CSE, JU
Component-basedarchitecturalmodelofamulti-DBS
MDBSprovidesalayerofsoftwarethatrunsontopofthese
individualDBMSsandprovidesuserswiththefacilitiesof
accessingvariousdatabases.
InadistributedMDBS,themulti-DBMSlayermayrunon
multiplesitesortheremaybecentralsitewherethoseservices
areoffered.
TheMDBSlayerissimplyanotherapplicationthatsubmits
requestsandreceivesanswers.
Database System Architectures
7/24/2017 85Md. Golam Moazzam, Dept. of CSE, JU
Thanks