您好,欢迎访问三七文档
当前位置:首页 > 办公文档 > 往来文书 > MTCacheICDE2004
-1-MTCache:TransparentMid-TierDatabaseCachinginSQLServerAbstractManyapplicationstodayruninamulti-tierenviron-mentwithbrowser-basedclients,mid-tier(application)serversandabackenddatabaseserver.Mid-tierdatabasecachingattemptstoimprovesystemthroughputandscal-abilitybyoffloadingpartofthedatabaseworkloadtoin-termediatedatabaseserversthatpartiallyreplicatedatafromthebackendserver.Thefactthatsomequeriesareoffloadedtoanintermediateservershouldbecompletelytransparenttoapplications-oneofthekeydistinctionsbetweencachingandreplication.MTCacheisaprototypemid-tierdatabasecachingsolutionforSQLServerthatachievesthistransparency.ItbuildsonSQLServer'ssup-portformaterializedviews,distributedqueriesandrepli-cation.ThispaperdescribesMTCacheandreportsexperimentalresultsontheTPC-Wbenchmark.Theex-perimentsshowthatasignificantpartofthequerywork-loadcanbeoffloadedtocacheservers,resultingingreatlyimprovedscale-outontheread-dominatedworkloadsofthebenchmark.Replicationoverheadwassmallwithanaveragereplicationdelayoflessthantwoseconds.1.IntroductionManyapplicationstodayaredesignedforamulti-tierenvironmenttypicallyconsistingofbrowser-basedclients,mid-tierapplicationserversandabackenddatabaseserver.Applicationserversdonotmaintainpersistentstateandtypicallyrunonfairlyinexpensivemachines.Hence,bot-tlenecksintheapplicationservertiercanbesolvedeasilyandcheaplybyincreasingthenumberofservers.Allpersistentstateismaintainedbythebackenddata-base,whichtypicallyrunsonasinglehigh-endmachine.Auserrequestmaycausetensorevenhundredsofqueriesagainstthebackenddatabase.Theoverallresponsetimeseenbyauserisoftendominatedbytheaggregatequeryresponsetime,particularlywhenthebackendsystemishighlyloaded.Toimproveperformanceandscalability,onemusteitherreducetheloadonthebackendserverorincreaseitscapacity.Thegoalofmid-tierdatabasecach-ingistotransfersomeoftheloadfromthebackenddata-baseservertointermediatedatabaseservers.Aninterme-diateserverhasalocaldatabasestoringacopyofsomeofthedatafromthebackenddatabase,whichallowssomequeriestobecomputedlocally.Akeyrequirementofmid-tierdatabasecachingthatalsodistinguishescachingfromreplicationisthatitmustbetransparenttoapplications.Thatis,addingcachingshouldnotrequireanychangesinapplications.Inparticu-lar,applicationsshouldnotbeawareofwhatiscachedandshouldnotberesponsibleforroutingrequeststothecacheortothebackendserver.Ifapplicationsarerequiredtorouterequeststotheappropriateserver,thecachingstrat-egycannotbechangedwithoutchangingapplications.ThispaperdescribesMTCache[21],amid-tierdata-basecachesolutionforMicrosoftSQLServerthatachievesthisgoal.WedescribeourdesignandprototypeimplementationandreportexperimentalresultsontheTPC-Wbenchmark.MTCacheisbasedonthefollowingapproach.•AshadowdatabaseiscreatedontheMTCacheserverthatcontainsthesametablesasthebackenddatabaseandalsothesameconstraints,indexes,views,permis-sions.Alltablesareemptybutthestatisticsmain-tainedontables,indexesandmaterializedviewsre-flectthedataonthebackendserver.•WhatdatatocacheisdefinedbycreatingmaterializedviewsontheMTCacheserver.Thesematerializedviewsmaybeselectionsandprojectionsoftablesormaterializedviewsonthebackendserver.•ThematerializedviewsontheMTCacheserverarekeptuptodatebySQLServerreplication.Whenaviewiscreated,amatchingreplicationsubscriptionisautomaticallycreatedandtheviewispopulated.•AllqueriesaresubmittedtotheMTCacheserverwhoseoptimizerdecideswhethertocomputeaquerylocally,remotelyorpartlocallyandpartremotely.Optimizationisentirelycostbased.•Allinserts,deletesandupdatesaresubmittedtotheMTCacheserver,whichthentransparentlyforwardsthemtothebackendserver.MTCacheexploitsSQLServer’ssupportformaterial-izedviews,distributedqueriesandtransactionalreplica-tion.Theuseofreplicationisnotinherentinourdesign;othermechanismsforpropagatingupdatesliketwo-phasecommitcouldbeused.Ourapproachresemblestheap-Per-ÅkeLarsonMicrosoftpalarson@microsoft.comJonathanGoldsteinMicrosoftjongold@microsoft.comJingrenZhouColumbiaUniversityjrzhou@cs.columbia.edu-2-proachtakenbyDBCache[2][3][14][20].However,DBCacheappearstobelimitedtocachingofcompletetableswhilewealsoallowcachingofhorizontalandverti-calsubsetsoftablesandmaterializedviews.Inaddition,DBCacheappearstoalwaysusethecachedversionofatablewhenitisreferencedinaquery,regardlessofthecost.InMTCachethisisnotalwaysthecase:thedecisionisdeeplyintegratedintotheoptimizationprocessandisentirelycost-based.Forinstance,ifthereisanindexonthebackendthatgreatlyreducesthecostofthequery;itwillbeexecutedonthebackenddatabase.MTCachealsoincludesimprovedoptimizationofpa-rameterizedqueriesthatresultsinmoreefficientuseofcacheddata.ThisisdonebyproducingdynamicplanswherethedecisionwhethertouseacachedviewismadeatruntimebasedontheactualparametervaluesThisisthefirstimplementationofdynamicplansinanindustrial-strengthdatabasesystem.Dynamicplansarecrucialfortheperformanceofparameterizedqueriesinacachingenvironmentbecausetheyexploitthecacheddataeffi-cientlywhileavoidingtheneedforfrequentreoptimiza-tion.TimesTenalsooffersamid-tiercachingsolutionbuiltontheirin-memorydatabaseman
三七文档所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
本文标题:MTCacheICDE2004
链接地址:https://www.777doc.com/doc-4685845 .html