版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
第二部分?jǐn)?shù)據(jù)庫系統(tǒng)實現(xiàn)技術(shù)主要內(nèi)容第3章存儲與文件結(jié)構(gòu)(簡介+自學(xué))第4章索引與散列(簡介+自學(xué))第5章查詢處理第6章查詢優(yōu)化第7章事務(wù)第8章并發(fā)控制第9章恢復(fù)系統(tǒng)開源代碼數(shù)據(jù)庫管理系統(tǒng)Derby/Cloudscape分析主要任務(wù)有選擇的深入了解并掌握部分DBMS核心模塊的實現(xiàn)細(xì)節(jié)通過對開源代碼數(shù)據(jù)庫管理系統(tǒng)Derby的分析,學(xué)習(xí)實現(xiàn)DBMS核心的相關(guān)技術(shù)原理開源代碼分析方法和技巧基礎(chǔ)收集整理相關(guān)資料對相關(guān)基本原理的深刻理解和掌握原則先總體(宏觀)后局部(微觀)先抽象(接口)后細(xì)節(jié)(實現(xiàn))步驟從系統(tǒng)架構(gòu)分析入手,逐步深入應(yīng)用軟件分析工具動手實驗和閱讀代碼很重要ArchitectureofaDBMSDiskSpaceManagerDBMSIndexFilesDataFilesSystemCatalogDatabaseArchitectureofaDBMSDiskSpaceManagerDBMSIndexFilesDataFilesSystemCatalogDatabaseApplications(WebForms,SQLInterface)ArchitectureofaDBMSFiles&AccessMethodsBufferManagerDiskSpaceManagerDBMSIndexFilesDataFilesSystemCatalogDatabaseApplications(WebForms,SQLInterface)ArchitectureofaDBMSFiles&AccessMethodsBufferManagerDiskSpaceManagerOperatorEvaluatorPlanExecutorParserOptimizerQueryExecutionEngineDBMSIndexFilesDataFilesSystemCatalogDatabaseApplications(WebForms,SQLInterface)ArchitectureofaDBMSTransactionManagerLockManagerConcurrencyControlFiles&AccessMethodsBufferManagerDiskSpaceManagerOperatorEvaluatorPlanExecutorParserOptimizerQueryExecutionEngineDBMSIndexFilesDataFilesSystemCatalogDatabaseApplications(WebForms,SQLInterface)ArchitectureofaDBMSTransactionManagerLockManagerConcurrencyControlRecoveryManager(Logging&Recovery)Files&AccessMethodsBufferManagerDiskSpaceManagerOperatorEvaluatorPlanExecutorParserOptimizerQueryExecutionEngineDBMSIndexFilesDataFilesSystemCatalogDatabaseApplications(WebForms,SQLInterface)ArchitectureofaDBMSTransactionManagerLockManagerConcurrencyControlRecoveryManager(Logging&Recovery)Files&AccessMethodsBufferManagerDiskSpaceManagerOperatorEvaluatorPlanExecutorParserOptimizerQueryExecutionEngineDBMSIndexFilesDataFilesSystemCatalogDatabaseApplications(WebForms,SQLInterface)AccessControlManagerArchitectureofaDBMSTransactionManagerLockManagerConcurrencyControlRecoveryManager(Logging&Recovery)Files&AccessMethodsBufferManagerDiskSpaceManagerOperatorEvaluatorPlanExecutorParserOptimizerQueryExecutionEngineDBMSIndexFilesDataFilesSystemCatalogDatabaseApplications(WebForms,SQLInterface)IntegrityManagerAccessControlManagerArchitectureofaDBMS(9/30)ArchitectureofaDBMSArchitectureofaDBMSInterfaceSQLCommandsDBMSArchitectureIntroducingApacheDerbyAnOpenSourscePureJavaRelationalDatabaseEngineWhat
isDerby?OpenSourceDatabaseTechnologyPureJavaEasytouseSmallfootprintStandardsbasedCompleterelationaldatabaseengineSecureSub-projectofApacheDBProject/derbyDerbyHistory1996:Cloudscapefounded–Oakland,CA1997:JDBMS1.0ReleasedApr1999:Cloudscape2.0Dec1999:AcquiredbyInformixSoftwareJune2001:Cloudscape4.0ReleasedJuly2001:AcquiredbyIBMDec2001:IBMCloudscape5.0Released2003:IBMCloudscape5.1,5.1FP1&FP2August2004:IBMdonatedCloudscapetoApacheJuly2005:DerbygraduatedfromApacheIncubatorDerby@ApacheSoftwareFoundationIBMcontributedtheCloudscapecodetoApacheSoftwareFoundationasDerbyReleasedundertheApachev2.0LicenseCommunityisgrowing,openinvitationtocontributetowardsthesuccessoftheprojectandcommunityParticipateasauser,contributor,orboth.ContributewithSourcecodeDocumentation(papers,presentationsetc.)Suggestions,ideas,bugreportsorjusthelpothersoutonthemaillistsMay16200521ApacheDerbyvs.CloudscapeDerby:DatabaseEngine+EmbeddedJDBCDriver+NetworkServer+Tools(ij,dblook,import/export)+Usermanuals(web-accessible)Clouldscape:Derby+TechnicalSupport+DB2UniversalJDBCDriver(JCC)+ODBC+DB2Plug-inforEclipse(databasebrowsingTool+Manuals(eclipse-basedandPDF)FeaturesofDerbyPureJavaEmbeddeddatabaseSmallfootprintStandardsbasedCompleterelationaldatabaseengineEasytouseanddeployPureJavaDatabasecodewritteninJavaWriteOnceRunAnywhereRequiresaJ2SE1.3,1.4or1.5virtualmachineAnyhardware,anyoperatingsystem,anyvendorSinglebinarydoesruneverywhereLinux,Windows,MacOs,AIX,Solaris,Z/OS,AS400,OS/390,…Databaseon-diskformatisplatformindependentSmallFootprintEnginejarfileisaround2MbOptionalJarfilesNetworkserver~150kTools~200kRuntimememoryuseDependentonapplication,datacachingetc.CanrunwhenJavaheapmemoryrestrictedto4MbHaveruninmachineswithonly16MbphysicalmemoryEmbeddedDatabaseDatabaseenginebecomesintegralpartoftheJavaapplicationNoadditionalprocess?Application'sJDBCcallsnowjustresultinmethodcallswithinsameJVMJustaJarfiletotheapplicationDatabaseinvisibletoenduserofapplicationEmbedded
DerbywithApplicationDatabaseonlyaccessiblefromsingleJVMJava/JDBConlyNonetworkconnectivityTypicallyissingleapplicationperJVM(butcouldbemultiple)Embedded
DerbywithApplicationEasytouseFastZeroadministrationEmbeddedinApplication
ServerDerbyEmbeddedPros:Invisibleatthedeployedsite–simplystartyourapplicationVerysimpletodeployandmanageStillhavemulti-threaded,multi-connectioncapabilityPerformanceisverygoodCons:Nonetworkingcapability(butnosecurityissues)Only1JVMcanaccessadatabaseatanygiventimeTraditionalClient/ServerJavaVirtualMachineDerbyengineNetwork
ServerDRDAJDBCCLI/ODBCMultipleClientapplications
-RemoteorlocalPHPontopofODBCClientApplications
ClientsprovidedbyIBMDMDatabase(s)ondiskDerby’sClient/ServerModeAccessfromasingleVMinembeddedmodecanbearestrictionNetworkServerallowsDerbytoactasatraditionalclientserverdatabaseIndustrystandardDRDAoverTCP/IPNetworkServeritselfispureJavaUsesembeddedJDBCdriveragainstDerbyIt’saJavaDRDAtoJDBCconverterNetworkServerClientsJDBCusingIBM’sDB2UniversalJDBCClientDifferentdriverandJDBCURLtoembeddedDataSourceandConnectionPoolingDataSourceODBC/CLIusingIBM’sDB2’sUniversalODBC/CLIclientEnablesPHP/Perl/.NETUniversaldriversenabledbyuseofDRDAJavaVirtualMachineDerbyengineNetwork
ServerDRDAJDBCCLI/ODBCEspeciallyusefuldeveloping
&debuggingembeddeddatabaseusage
PHPontopofODBCClientApplications
ClientsprovidedbyIBMDMDatabase(s)ondiskEmbeddedNetworkServerApplicationEmbeddedNetworkServerAddsontoembeddedenginetoprovideaccesstodatabasefromoutsidetheapplication’sVM(fromlocalorremotemachine)AllowsdeveloperstoworkondatabasewhilestandaloneapplicationisrunningAllowsreportingcapabilitytobeaddedontoastandaloneapplicationEnabledbypropertysettingandadditionaljarfile,nocodechangestoapplicationderby.drda.startNetworkServer=trueODBC/DerbyenvironmentInstallDB2Run-TimeClientStartDerbyNetworkServer(Derbymustbeinstalled!)ConfigureDerbyDBasODBCDataSourceCatalognodeanddatabaseviaDB2CommandLineProcessor,CLPCatalogdatabaseasODBCdatasourcedb2=>catalogtcpipnodeDNSremotelocalhostserver1527--DerbyNetworkServerdb2=>catalogdbDDBatnodeDNSauthenticationserverdb2=>catalogsystemodbcdatasourceDDBWriteanODBCApplicationtoaccesstheDerbydatabase,DDBCompleteRelationalEngineSQLTables,indexes,views,triggers,procedures,functions,temptablesforeignkeysandconstraintsjoins,costbasedoptimizerMulti-user,transactions,isolationlevels,deadlockdetection,crashrecovery,backup&restoreDatacaching,statementcaching,writeaheadlogging,groupcommitMultipledatabasespersystemStandardstoAllowMigrationDerbydoesperformwellinitsownrightLackingfeaturesofanenterpriseDBDeveloponDerby,deployonenterpriseDBInitialdeployonDerby,migratetoenterpriseDBasneededStandardsBasedSQLSQL92,SQL99,SQL2003,SQL/XML,…JavaJ2SE1.3,1.4,1.5J2ME/OSGiJDBC2.0&3.0JSR169J2EE–JDBCpassedCTSforJ2EE1.4&1.3DRDAV3OpenGroup(/)DerbyToolsij–SQLscriptingtoolJDBCneutral,canbeusedagainstotherJDBCdriversdblook–schemaextractiontoolforDerbysysinfo–DerbyversioninformationOutputusefulforbugrepoRTINginJiraDerbyIntegrationDerbyisreportedtoworkwithActiveMQ,Cocoon,C-JDBC,Daffodil,db2db,DB2Everyplace,DOTS,DroneIRCBot,Eclipse,Geronimo,Hibernate,iBATIS,IBMDB2JDBCUniversalDriver,IKVM.NET,iSQL-Viewer,SunJ2EESDK,JBoss,JOnAS,JPOXJDO,Jython,Maven,RedHatApplicationServer,RIFE,SQuirreLSQL,Sync4j,TomcatEasytoUseandDeployDerbyiseasytouseDesignedforJavadevelopers(standardJDBCcommands)Simplyloadthedriverandconnecttoadatabaseandyou’reinbusinessDerbyiseasytodeploySimplydeploythejarfile(s)andsettheusersclasspathEmbeddedrequiresnostartingandstoppingofaserverDesignedtobezeroadmin:noupdatestatistics,spacereclamation,logmanagement,etc.requiredEverythingcanbedoneprogrammaticallyincludingdatabasebackups,settingproperties,etc.DerbyArchitectureModuleArchitectureModuleSetofusablefunctionalityWelldefinedAPI–“protocol”ProtocolseparatedfromimplementationTypicallydeclaredassetofJavainterfacesIdentifiedbysingleJavainterface,“factoryclass”?.apache.derby.iapi.services.locks.LockFactoryMayreferenceothermoduleprotocolsZeroormoreimplementationsinarunningsystemImplementationcanimplementcontrolinterfacesto:?Defineadditionalboot&shutdownactions?DefinesuitabilityforrequestedfunctionalityServiceCollectionofco-operatingmodulesprovidingacompletesetoffunctionalitySingleprimarymoduledefiningexternalAPIPersistent?Boot-upstateinsinglepertiesfile,includingtherequiredprimarymoduleidentification(astheprotocol,nottheimplementation)Non-persistent?Purelyrun-timedefinitionModulesalwaysbootedthroughmonitorMonitorManagesDerbysystemBoots&shutdownServicesFindspertiesfilebaseduponservicebootMapsrequestsforamoduleprotocoltoanimplementationBasedupon:?Virtualmachineenvironment(J2ME/J2SE1.3/1.4)?Availableclasses(e.g.JCEencryptionclasses)?SuitabilityforcurrentserviceEnsuressystemisnotgarbagecollectedawayDatabaseEngineSystemSingleActiveThreadper
SessionCache/Lock
ManagersCacheManagercachesobjectsthatimplementaCacheableinterfaceHandlesaging,pruning,etc.Cachespages,statements,stringtranslations,openfiles,dictionaryobjectsLockManagerlocksobjectsthatimplementaLockableinterfaceLockcompatibilitydefinedbyLockable,notmanagerCentralizes“hard”thread-safeissuesSQLCompilationPreparedStatementps=conn.prepareStatement(“SELECT*FROMTWHEREID=?”);1)Lookupincacheusingexacttextmatch(skipto5ifplanfoundincache)2)ParseusingJavaCCgeneratedparser3)Bindtodictionary,gettypes,etc.4)Generatecodeforplan5)CreateinstanceofplanParsePhaseTreeofQueryNodescreatedManyNodes,oneperoperationtype?FromBaseTable,MethodCallNode,DistinctNode,CurrenUserNode,...?BulkofcodefootprintisSQLcompilerNoexecutioncodeinQueryNodes,leadstosimilarsetofexecutionResultSetsDuplicatecheckingofstateinQueryGeneratePhaseGenerateJavabytecodedirectly,intoin-memorybytearrayLoadwithspecialClassLoaderthatloadsfromthebytearraySingleClassLoaderpergeneratedclassAllowsstatementstobeagedoutindependentlyGeneratedclassextendsaninternalclassBaseActivationwhichprovidessupportmethods,commonfunctionalityActivation–InstanceofplanInstanceofgeneratedclasscalledActivationHoldsqueryspecificstate,parameters,etc.ConnectedindirectlytoJDBCPreparedStatementthroughholder/wrapperclassthatimplementsActivationinterfaceHolderallowscompiledplantochangewithoutknowledgeofapplication,transparenttoPreparedStatementActivation–ExecutionPreparedStatement.execute()methodsCreatestreeofinternalResultSetobjectsthatmaptoSQLoperations?ScanResultSet?SortResultSet?IndexScanResultSetGeneratedcodemaingluecodeExpressionsaregeneratedasmethodsingeneratedclassStatementResultsBenefitsofGeneratedCodeNoneedtohaveDerbyspecificinterpreterwritteninJava,justuseJVMGeneratedcodewillgetJIT'edandthusgaintheperformancebenefitsTightintegrationwithJavacallsfromSQL,e.g.SQLfunctionswritteninJava.Nouseof(slow)reflection,justcompilemethodc
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 松原長嶺縣衛(wèi)健系統(tǒng)事業(yè)單位招聘工作人員考試試卷及答案
- 成都市第四人民醫(yī)院招聘考試試卷及答案
- 新學(xué)期計劃模板錦集9篇資料
- 新學(xué)期的計劃模板十篇資料
- 2014年貴州省畢節(jié)市中考數(shù)學(xué)試卷(含解析版)
- 二級建造師之二建建設(shè)工程法規(guī)及相關(guān)知識題庫【典優(yōu)】
- 中建建筑施工現(xiàn)場工具式標(biāo)準(zhǔn)化圖集
- 2020年遼寧本溪中考滿分作文《我的重要時刻》2
- 導(dǎo)視系統(tǒng)套餐執(zhí)行手冊
- 鎢鉬礦選礦廠環(huán)境保護(hù)與綠色礦山建設(shè)考核試卷
- 小學(xué)道法二 我自豪 我是中國人課件
- 井控安全事故心得體會通用8篇
- 漢字文化解密學(xué)習(xí)通課后章節(jié)答案期末考試題庫2023年
- 管道試壓方案樣本
- 四年級下冊英語人教PEP版課件U1-A Let's spell
- 智慧中藥房管理與服務(wù)規(guī)范
- 【沃爾瑪財務(wù)風(fēng)險管理研究5400字(論文)】
- 農(nóng)產(chǎn)品分揀配送中心運營方案
- matlab教程(完整版)課件
- 部編版四年級語文上冊看拼音寫漢字全冊(附答案)
- 2023年公路水運工程試驗檢測師《水運結(jié)構(gòu)與地基》考試題庫大全-上(單選題)
評論
0/150
提交評論