您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 人事档案/员工关系 > 基于云的高性能分布式内存数据库的开发技术
Copyright©VersantCorp.Allrightsreserved.0001基于云的高性能分布式内存数据库开发技术ByTigerLau,CTOofVersantChina性能,灵活性灵活性,支持查询性能性能优点复杂简单简单简单数据对象型关系型网络化层次化,结构化模型随机性较强,支持既成的查询性能灵活性,对查询的支持灵活性,对查询的支持缺点这两点是现有很多系统的核心问题所在数据库发展简史VersantObjectManagerVersantObjectManagerVersantNetworkLayerVersantNetworkLayerVersantServerVersantServerVirtualSystemLayerVirtualSystemLayerVersantNetworkLayerVersantNetworkLayerOtherInterfaces,Tools,etc.OtherInterfaces,Tools,etc.VersantC++InterfaceVersantC++InterfaceVersantJavaInterfacesVersantJavaInterfacesVersantCInterfaceVersantCInterfaceVersant数据库系统架构RawDevices,FileSystems,RAID,SAN,NASRawDevices,FileSystems,RAID,SAN,NASVersantServerVersantClientVersantStorageManagerVersantStorageManagerLogicalLogFileLogicalLogFilePhysicalLogFilePhysicalLogFileDatabaseVolume(s)DatabaseVolume(s)PageCacheBEProfileBEProfileRoll-forwardlogRoll-forwardlogObjectCacheUserInterfaceApplicationVersantObjectManagerVersantObjectManagerVersantObjectManagerApplicationLogicApplicationLogicUserInterfaceUserInterfaceFEProfileFEProfileVersant数据库的双缓存架构ACIDTransactionsIndexingSMPSupportEventNotificationFaultTolerantServerReplicationScaletoTerabytesDualLoggingSQLODBCJDBCQueryQueryQueryEngineEngineServerServercachecachePhysicalPhysicalLogicalLogicalRelationalServerRelationalServerQueryDualLoggingClientCacheTransactionalControlQueryQueryEngineEngineTablesObjectsServerServercachecachePhysicalPhysicalLogicalLogicalSQLODBCJDBCSQLCC++Java.NET架构对比:RDBMSvsVERSANTVersant数据库可以实现灵活的多线程架构ClientThreadClientThreadClientThreadClientThreadClientThreadClientThreadClientThreadClientThreadClientThreadClientThreadClientThreadClientThreadClientProcessClientProcessSessionObject/ObjectCacheSessionObject/ObjectCacheSessionObject/ObjectCacheLogBufferThreadLogBufferThreadBackgroundPageFlusherBackgroundPageFlusherServerThreadServerThreadServerThreadServerThreadServerThreadServerThreadPageCacheLockTableServerProcessasyncI/Oofnon-commitbufferwriteswritesmodifiedpagestodisk内存模型与存储模型不一致从存储模型映射成内存模型时有巨大的性能消耗更多的转换代码编程语言和数据操作语言不一致,存在“失配”问题SELECTFROMtable1...;SELECTFROMtable2...;convert_tables_to_memory();Orderorder=newOrder()for(i=0;i100;i++){OrderLinep=newOrderLine();…order.addLine(p)}convert_memory_to_tables();INSERTINTOtable1...;UPDATEtable2...;SELECTFROMtable1...;SELECTFROMtable2...;convert_tables_to_memory();Orderorder=newOrder()for(i=0;i100;i++){OrderLinep=newOrderLine();…order.addLine(p)}convert_memory_to_tables();INSERTINTOtable1...;UPDATEtable2...;In-MemoryRDBMSTables传统关系型数据库在OR-Mapping领域面临困难内存模型与存储模型相一致高性能的大数据量对象操作(排序等)没有额外的转换代码强化的程序生产力程序开发语言即DML与DDLVERSANTOrderorder=newOrder()for(i=0;i100;i++){OrderLinep=newOrderLine();…order.addLine(p)}Orderorder=newOrder()for(i=0;i100;i++){OrderLinep=newOrderLine();…order.addLine(p)}In-MemoryVersant数据库能够更好支持复杂数据$$Employeeemp=newHourlyEmployee(“Meier”);transaction.commit().soc_nohour_rateover_ratemax_oversoc_nomonth_ratebonus_pctsoc_noemp_namebirth_datedept_name由于继承对象需要拆分之后才能存储到关系数据库中,需要额外的编码,维护难度加大,性能大幅降低由于继承对象需要拆分之后才能存储到关系数据库中,需要额外的编码,维护难度加大,性能大幅降低Employeesoc_noemp_namebirth_datedept_nameHourlyEmphour_rateover_ratemax_overSalariedEmpmonth_ratebonus_pctCompanycomp_nameemployeesdepartments例:关系数据库在解决继承对象存储时的困境createtableEmployee_Table(emp_idnumberprimarykeysoc_nonumberuniqeemp_namevarcharBirth_datedatedept_idnumberforeignkey)createtableHourly_Emp_Table(emp_idnumberprimarykeyforeignkeyhour_ratedecimalover_ratedecimalmax_overdecimal)createtableSalaried_Emp_Table(emp_idnumberprimarykeyforeignkeymonth_ratedeciamlbonus_pctdecimal)createtableDepartment_Table(......)createsequence......$$EXECSQLINSERTINTOEmployee_Table(soc_no,emp_name,birth_date,dept_name)VALUES(:emp-soc_no,:emp-name,:emp-birth_date,:emp-dept_name);if(emp-type==1)EXECSQLINSERTINTOHourly_emp_Table(soc_no,hour_rate,over_rate,max_over)VALUE(:emp-soc_no,:emp-hour_rate,:emp-over_rate,:emp-max_over);elseif(emp-type==2)EXECSQLINSERTINTOSalaried_emp_Table(soc_no,month_rate,bonus_pct)VALUES(:emp-soc_no,:emp-month_rate,:emp-bonus_pct)EXECSQLCOMMITWORKRELEASE;Employeeemp=newHourlyEmployee(“Meier”);transaction.commit().soc_nohour_rateover_ratemax_oversoc_nomonth_ratebonus_pctsoc_noemp_namebirth_datedept_nameEmployeesoc_noemp_namebirth_datedept_nameHourlyEmphour_rateover_ratemax_overSalariedEmpmonth_ratebonus_pctCompanycomp_nameemployeesdepartments例:Versant数据库解决继承对象存储轻而易举由于继承对象需要拆分之后才能存储到关系数据库中,需要额外的编码,维护难度加大,性能大幅降低由于继承对象需要拆分之后才能存储到关系数据库中,需要额外的编码,维护难度加大,性能大幅降低importcom.versant.trans.*;publicclassSample{staticpublicmain(Stringargs){TransSessionsession=newTransSession(args[0]);Departmentd1=newDepartment(“技术部”);Departmentd2=newDepartment(“客服部”);Employeep1=newHourlyEmployee(“001”,“Joe”,newDate(1980,1,1),d1,...);Employeep2=newSalariedEmployee(“101”,”man”,newDate(1960,9,1),d1,...);p1.setDepartment(d2);session.makePersistent(p1);session.commit();}}JAVA程序—主程序Employee.javaEmployee.javajavacjavacEnhancerEnhancerConfigFileConfigFilejavaEmployeemydbjavaEmployeemydbEmployee.classEmployee.classEmployee.classEmployee.classconfig.jvi配置文件cEmployeecHourlyEmployeecSalariedEmployeecDepartm
本文标题:基于云的高性能分布式内存数据库的开发技术
链接地址:https://www.777doc.com/doc-5010165 .html