Escolar Documentos
Profissional Documentos
Cultura Documentos
Version:Oct5,2006
DatabaseSystemConcepts,5thEd.
Silberschatz,KorthandSudarshan Seewww.dbbook.comforconditionsonreuse
Chapter20:DatabaseSystemArchitectures
s CentralizedandClientServerSystems s ServerSystemArchitectures s ParallelSystems s DistributedSystems s NetworkTypes
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
CentralizedSystems
s Runonasinglecomputersystemanddonotinteractwithother
computersystems.
s Generalpurposecomputersystem:onetoafewCPUsandanumber
s Singleusersystem(e.g.,personalcomputerorworkstation):desktop
s Multiusersystem:moredisks,morememory,multipleCPUs,anda
multiuserOS.Servealargenumberofuserswhoareconnectedto thesystemvieterminals.Oftencalledserversystems.
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
ACentralizedComputerSystem
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
ClientServerSystems
s Serversystemssatisfyrequestsgeneratedatmclientsystems,whosegeneral
structureisshownbelow:
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
ClientServerSystems(Cont.)
s Databasefunctionalitycanbedividedinto:
q
s TheinterfacebetweenthefrontendandthebackendisthroughSQLor
throughanapplicationprograminterface.
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
ClientServerSystems(Cont.)
s Advantagesofreplacingmainframeswithnetworksofworkstationsor
personalcomputersconnectedtobackendservermachines:
q q q q
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
ServerSystemArchitecture
s Serversystemscanbebroadlycategorizedintotwokinds:
q
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
TransactionServers
s AlsocalledqueryserversystemsorSQLserversystems
q q q
s RequestsarespecifiedinSQL,andcommunicatedtotheserver
througharemoteprocedurecall(RPC)mechanism.
s TransactionalRPCallowsmanyRPCcallstoformatransaction. s OpenDatabaseConnectivity(ODBC)isaClanguageapplication
programinterfacestandardfromMicrosoftforconnectingtoaserver, sendingSQLrequests,andreceivingresults.
s JDBCstandardissimilartoODBC,forJava
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
TransactionServerProcessStructure
s Atypicaltransactionserverconsistsofmultipleprocessesaccessing
datainsharedmemory.
q
s Serverprocesses
s Lockmanagerprocess
q
s Databasewriterprocess
q
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
TransactionServerProcesses(Cont.)
s Logwriterprocess
q q
s Checkpointprocess
q
s Processmonitorprocess
q
E.g.abortinganytransactionsbeingexecutedbyaserverprocess andrestartingit
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
TransactionSystemProcesses(Cont.)
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
TransactionSystemProcesses(Cont.)
s Sharedmemorycontainsshareddata
q q q q
s Alldatabaseprocessescanaccesssharedmemory s Toensurethatnotwoprocessesareaccessingthesamedatastructure
atthesametime,databasessystemsimplementmutualexclusion usingeither
q q
Operatingsystemsemaphores Atomicinstructionssuchastestandset
s Toavoidoverheadofinterprocesscommunicationforlock
request/grant,eachdatabaseprocessoperatesdirectlyonthelock table
q
insteadofsendingrequeststolockmanagerprocess
s Lockmanagerprocessstillusedfordeadlockdetection
DatabaseSystemConcepts5thEdition 20.<number> Silberschatz,KorthandSudarshan
DataServers
s UsedinhighspeedLANs,incaseswhere
q q
Theclientsarecomparableinprocessingpowertotheserver Thetaskstobeexecutedarecomputeintensive.
s Dataareshippedtoclientswhereprocessingisperformed,andthen
shippedresultsbacktotheserver.
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
DataServers(Cont.)
s Pageshippingversusitemshipping
q q q
Smallerunitofshippingmoremessages Worthprefetchingrelateditemsalongwithrequesteditem Pageshippingcanbethoughtofasaformofprefetching Overheadofrequestingandgettinglocksfromserverishighdue tomessagedelays Cangrantlocksonrequestedandprefetcheditems;withpage shipping,transactionisgrantedlockonwholepage. LocksonaprefetcheditemcanbeP{calledback}bytheserver, andreturnedbyclienttransactioniftheprefetcheditemhasnot beenused. Locksonthepagecanbedeescalatedtolocksonitemsinthe pagewhentherearelockconflicts.Locksonunuseditemscan thenbereturnedtoserver.
s Locking
q q q
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
DataServers(Cont.)
s DataCaching
q q q
s LockCaching
q q
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
ParallelSystems
s Paralleldatabasesystemsconsistofmultipleprocessorsandmultiple
disksconnectedbyafastinterconnectionnetwork. powerfulprocessors
s Acoarsegrainparallelmachineconsistsofasmallnumberof s Amassivelyparallelorfinegrainparallelmachineutilizes
thousandsofsmallerprocessors.
q
s Twomainperformancemeasures:
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
SpeedUpandScaleUp
s Speedup:afixedsizedproblemexecutingonasmallsystemisgiven
toasystemwhichisNtimeslarger.
q
Measuredby:
speedup=smallsystemelapsedtime largesystemelapsedtime
q
s Scaleup:increasethesizeofboththeproblemandthesystem
q q
scaleup=smallsystemsmallproblemelapsedtime bigsystembigproblemelapsedtime
q
Scaleupislinearifequationequals1.
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
Speedup
Speedup
DatabaseSystemConcepts5thEdition 20.<number> Silberschatz,KorthandSudarshan
Scaleup
Scaleup
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
BatchandTransactionScaleup
s Batchscaleup:
q
Asinglelargejob;typicalofmostdecisionsupportqueriesand scientificsimulation. UseanNtimeslargercomputeronNtimeslargerproblem. Numeroussmallqueriessubmittedbyindependentuserstoa shareddatabase;typicaltransactionprocessingandtimesharing systems. Ntimesasmanyuserssubmittingrequests(hence,Ntimesas manyrequests)toanNtimeslargerdatabase,onanNtimes largercomputer. Wellsuitedtoparallelexecution.
s Transactionscaleup:
q
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
FactorsLimitingSpeedupandScaleup
Speedupandscaleupareoftensublineardueto:
s Startupcosts:Costofstartingupmultipleprocessesmaydominate
computationtime,ifthedegreeofparallelismishigh.
s Interference:Processesaccessingsharedresources(e.g.,system
s Skew:Increasingthedegreeofparallelismincreasesthevariancein
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
InterconnectionNetworkArchitectures
s Bus.Systemcomponentssenddataonandreceivedatafromasingle
communicationbus;
q
Doesnotscalewellwithincreasingparallelism.
s Mesh.Componentsarearrangedasnodesinagrid,andeach
componentisconnectedtoalladjacentcomponents
q q
s Hypercube.Componentsarenumberedinbinary;componentsare
connectedtooneanotheriftheirbinaryrepresentationsdifferin exactlyonebit.
q
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
InterconnectionArchitectures
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
ParallelDatabaseArchitectures
s Sharedmemoryprocessorsshareacommonmemory s Shareddiskprocessorsshareacommondisk s Sharednothingprocessorsshareneitheracommonmemorynor
commondisk
s Hierarchicalhybridoftheabovearchitectures
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
ParallelDatabaseArchitectures
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
SharedMemory
s Processorsanddiskshaveaccesstoacommonmemory,typicallyvia
abusorthroughaninterconnectionnetwork.
s Extremelyefficientcommunicationbetweenprocessorsdatain
s Downsidearchitectureisnotscalablebeyond32or64processors s Widelyusedforlowerdegreesofparallelism(4to8).
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
SharedDisk
s Allprocessorscandirectlyaccessalldisksviaaninterconnection
network,buttheprocessorshaveprivatememories.
q q
s Examples:IBMSysplexandDECclusters(nowpartofCompaq)
runningRdb(nowOracleRdb)wereearlycommercialusers subsystem.
s Downside:bottlenecknowoccursatinterconnectiontothedisk s Shareddisksystemscanscaletoasomewhatlargernumberof
processors,butcommunicationbetweenprocessorsisslower.
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
SharedNothing
s Nodeconsistsofaprocessor,memory,andoneormoredisks.
s Examples:Teradata,Tandem,OraclenCUBE s Dataaccessedfromlocaldisks(andlocalmemoryaccesses)donot
s Sharednothingmultiprocessorscanbescaleduptothousandsof s Maindrawback:costofcommunicationandnonlocaldiskaccess;
sendingdatainvolvessoftwareinteractionatbothends.
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
Hierarchical
s Combinescharacteristicsofsharedmemory,shareddisk,andshared
nothingarchitectures.
s Toplevelisasharednothingarchitecturenodesconnectedbyan
s Eachnodeofthesystemcouldbeasharedmemorysystemwitha s Alternatively,eachnodecouldbeashareddisksystem,andeachof
thesystemssharingasetofdiskscouldbeasharedmemorysystem. virtualmemoryarchitectures
q
s Reducethecomplexityofprogrammingsuchsystemsbydistributed
Alsocallednonuniformmemoryarchitecture(NUMA)
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
DistributedSystems
s Dataspreadovermultiplemachines(alsoreferredtoassitesor
nodes).
s Networkinterconnectsthemachines s Datasharedbyusersonmultiplemachines
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
DistributedDatabases
s Homogeneousdistributeddatabases
q q
Samesoftware/schemaonallsites,datamaybepartitioned amongsites Goal:provideaviewofasingledatabase,hidingdetailsof distribution Differentsoftware/schemaondifferentsites Goal:integrateexistingdatabasestoprovideusefulfunctionality Alocaltransactionaccessesdatainthesinglesiteatwhichthe transactionwasinitiated. Aglobaltransactioneitheraccessesdatainasitedifferentfrom theoneatwhichthetransactionwasinitiatedoraccessesdatain severaldifferentsites.
s Heterogeneousdistributeddatabases
q q
s Differentiatebetweenlocalandglobaltransactions
q q
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
TradeoffsinDistributedSystems
s Sharingdatausersatonesiteabletoaccessthedataresidingat
someothersites. storedlocally.
replicatedatremotesites,andsystemcanfunctionevenifasitefails. coordinationamongsites.
q q q
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
ImplementationIssuesforDistributed Databases
s Atomicityneededevenfortransactionsthatupdatedataatmultiplesites s Thetwophasecommitprotocol(2PC)isusedtoensureatomicity
q
s 2PCisnotalwaysappropriate:othertransactionmodelsbasedon
persistentmessaging,andworkflows,arealsoused
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
NetworkTypes
s Localareanetworks(LANs)composedofprocessorsthatare
s Wideareanetworks(WANs)composedofprocessorsdistributed
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
NetworksTypes(Cont.)
s WANswithcontinuousconnection(e.g.theInternet)areneededfor
implementingdistributeddatabasesystems discontinuousconnection:
q q q q
s GroupwareapplicationssuchasLotusnotescanworkonWANswith
DatabaseSystemConcepts5thEdition
20.<number>
Silberschatz,KorthandSudarshan
EndofChapter
DatabaseSystemConcepts,5thEd.
Silberschatz,KorthandSudarshan Seewww.dbbook.comforconditionsonreuse