Object-oriented database

honggarae 11/02/2022 946

Introduction

Object-orienteddatabasesystem(OODBS)supportsthedefinitionandoperationofOODB,andshouldmeettwostandards:first,itisadatabasesystem,andsecond,itisalsoanobject-orientedsystem.Thefirststandardisthecapabilitiesthatadatabasesystemshouldhave(persistence,transactionmanagement,concurrencycontrol,recovery,query,versionmanagement,integrity,security).Thesecondstandardistorequiretheobject-orienteddatabasetofullysupportthecompleteobject-oriented(OO)conceptandcontrolmechanism.Insummary,weabbreviateobject-orienteddatabaseas:object-orienteddatabase=object-orientedsystem+databasecapabilities.

Object-orientedisacognitivemethodology,butalsoanewprogrammingmethodology.Combiningobject-orientedmethodsanddatabasetechnologycanmaketheanalysisanddesignofthedatabasesystemconsistentwithpeople'sunderstandingoftheobjectiveworldtothegreatestextent.Object-orienteddatabasesystemisanewgenerationofdatabasesystemproducedtomeettheneedsofnewdatabaseapplications.

Basictechnology

Databaseconversiontechnology

Theconversionbetweendatabasemodesandoperationsinheterogeneousdatabasesystemsisakeyresearchtopic.Sincerelationaldatabasesystemsdominatethecurrentdatabaseapplicationfields,andobject-orienteddatabasescanmeethigher-leveldatabaserequirements,itisnecessarytoestablishamappingrelationshipbetweenthesetwodatabasemodelstoachievemutualconversionbetweenmodesandoperations.

Therearegenerallytwowaystoconvert:fromrelationalDBtoobject-orientedDB(RDBtoOODB)andfromobject-orientedDBtorelationalDB(OODBtoRDB).OODBtoRDBconversiontechnologymustensureconsistencyduringconversion(objectsemanticsandactioninformationarenotlostduringtheconversionprocess).Conversionincludesdatamodeanddataoperationconversion.

Datamodeconversion

Theobjectidentifieristheonlysignoftheexistenceofanobject.Thesametwoobjectsareequivalenttothesameidentifier.Thedifferencefromtherelationalmodelisthattheclassattributesinobject-orientedaredividedintoatomicattributes,compositeattributesandcollectionattributes.DatamodeconversionreferstotheconversionfromOODBtoRDBdatadescriptionlanguage(DML).Thebasicideaistoextendthepropertiesoftheparentclasstoallsubclasses,andeachclassismappedtoarelationship;eachpropertyoftheclassismappedtoitscorrespondingrelationshipAttributes.Differenttypesofattributesintheclassaretreateddifferently.ThedefaultobjectidentifierattributeismappedtotheRDBkeywordattribute,theatomicattributeismappedtoafixedattribute,thecombinedattributeismappedtoaforeignkeyrelatedtothecorrespondingkeyofthemainattribute,andthesetattributeismappedtoanatomicattributeplusarelationshipwithtwoattributes.,Oneoftheattributesistosettheconnectionwiththecorrespondingcollectionattribute;theotherattributeistodealwiththecollectionelement.Methodconversionisanimportantconversionofdatamodeconversion,andmethodshavedefinitionsandcalls.StandardRDBdoesnothaveamechanismtosupportuser-definedfunctionsandprocedures.Inrecentyears,somecommercialRDBMSprovidethesefunctions,calledPSMsubroutines(includinguser-definedfunctionsandprocedures).ThestandardPSMsubroutinesupportsatleastthefollowingtwofunctions:

①Createauser-definedfunction,andcallthisfunctionfromascalarexpression;

②Createauser-definedprocess,andCalltheseproceduresthroughanewSQLstatement(typicallyCALL).

InheritanceisatypicalfeatureofOODBMS.M.Blahaproposesfourmethodstodealwithinheritancebymeansofrelationaltables,thecoreofwhichistoconverteachclassinthehierarchicalstructureintoatable.

Dataoperationconversion

DatamodeconversionreferstotheconversionfromOODBtoRDBDataManipulationLanguage(DCL).ThisarticledescribesfromtheperspectiveofOODBtoRDB.Commondatabaseoperationsincludedataquery,insertion,deletion,andmodification,allofwhichareinseparablefromrestrictions,solet'stalkaboutrestrictionconversionfirst.

Weuseandtodenoteclassrestrictionsandrelationshiprestrictions,respectively.Incontrast,hastwomoremechanismsthan:thepathexpressionoperandmechanismandthesetoperandandoperator.isobtainedbydirectlysettingcertainattributesofclassCandcombiningclassCastherootofthequalifyingpredicateinthehierarchicalstructure.Accordingtowegetaclass-qualifiedgraphGC,andeachalsocorrespondstoarelation-qualifiedgraphGR.Whenimplementingrestrictionconversion,usuallyfirstconstructaccordingto,thenconvertGCtoGR,andfinallygeneratefromGR.Dataqueryconversionistheconversionofobjectqueryoperationstorelationalqueryoperations.Theprocessistoselectthetuplecorrespondingtothequalifiedobjectoffromthemappingrelationshipofthespecifiedclassand/orallitssubclasses(restrictedbytherelationshipqualification).

Datamodificationconversionistheconversionofobjectmodificationoperationsintorelationalmodificationoperations.ThisoperationislimitedbyQR(mappedby),andtheprocessistodeletealloldtuplesandtheninsertnewtuples.Datainsertionconversionissimilartothis.Thedatadeletionconversionistoconverttheobjectdeletionoperationtotherelationaldeletionoperation.Theoperationislimitedby(obtainedbyQCmapping).Atthistime,theforeignkeyattributesinthetuplescorrespondingtothesecombinedobjectsmustbechanged.SettoNULL.

Patternevolutiontechnology

Classesinobject-orienteddatabaseschangeovertimetoadapttochangesindemand,calledpatternevolution,includingcreatingnewclasses,deletingoldclasses,modifyingclassattributesandoperationsWait.Modeevolutionmustmaintainmodeconsistency(nocontradictionswithinthemodeitself),whichisdescribedbymodeconsistencyconstraints.Schemaconsistencyconstraintscanbedividedintouniqueconstraints(thenameisuniqueinthesamemodel),existenceconstraints(showingthatthereferencedcomponentmustexist),andsub-typeconstraints(therelationshipbetweenthesubclassandtheparentclasscannotbelooped,andtherecanbenoinheritancefrommultipleAnyconflicts,etc.),etc.,themodethatsatisfiesalltheseconsistencyconstraintsiscalledtheconsistentmode.Schemaevolutionhasalwaysbeenthefocusanddifficultyofobject-orienteddatabaseresearch.Therearegenerallytwowaystosolvetheproblem:

①Themodechangeconsiderstheexistingapplications,sothatthetwocanbeintegratedandadaptedtoeachother.

②Developanewhigh-leveldatabaseprogramminglanguage.

CommonlyusedevolutionmethodsincludeTSE(transparentmodeevolution),equivalentmodeevolution,anddatadictionary-basedmodeevolution.

Indexingtechnology

Object-orienteddatabasedataishugeandcomplex.Ifthereisnogoodindexprocessing,thedataprocessingefficiencyisverylow.Theindexingprocessistheprocessofanalyzingthemainbodyandcharacteristicsofthedataandassigningsigns.Dataindexingtechnologyisdividedintothreetypes:inheritedindex,clusteredindexandintegratedindex.Seetheliteratureforspecifictechnicalcharacteristics.

Transactionmanagementtechnology

TraditionalDatabasetransactionManagementcharacteristicsandshortcomings

Traditionaldatabasetransactionmanagementconsistsoftwoparts:concurrencycontrolandrecovery.Usuallythelockprotocolisusedtoachieveconcurrencycontrol,andthelogprotocolisusedtoachieverecovery.Long-termaffairsandcollaborativeaffairsareneededinapplicationfieldssuchasengineeringdesign.However,theatomicityoftransactionsmakesthatifthelongtransactioncannotbecompleted,alltheworkthathasbeendonehastobeabandoned;whiletheserialitymakesothertransactionsmustwaitifthelongtransactiondoesnotend,causingthetraditionalconcurrencycontrolmethodtobeextremelyinefficient.

TechnicalcharacteristicsofOODBStransactionmanagement

TheOODBStransactionmanagementsubsystemisshowninFigure1.Amongthem,thelockmanagermanagesthelocktable,storingsingleactivetransactionmanagementlocksandwaitinglocks.Thestoragesubsystemandthelockmanagerimplementtheobjectlockoperation,andthelockisreleasedattheendofthetransaction.Thedeadlockmanagerdetectsandremovesdeadlocks.Thesystemusestimeoverflowtechnology,thatis,eachapplicationhasatimelimit,andthedeadlockmanagerwillabandonthetransactionifthetimeoverflows.Logmanagementrecordsobjectmodificationlogs.ComparedwithtraditionalRDBS,thecharacteristicsofOODBSlockingtechnologyare:thelogicalunitoflockingisanobjectinsteadofaclass;lockingaclassobjectrequiresmoreinformationthanlockingarelationalobject;whenaclassinstanceislocked,Itssuperclassesarealsolocked.Thesizeofthelockediteminthedatabaseiscalledthegranularity.Whenthecoarse-grainedlockmechanismisadopted,thecostofconcurrentprogramunlockingislow,butthesystemispoorlydistributed;thefine-grainedlockmechanismensuresahighdegreeofconcurrency,butthesystemunlocksthecost.OODBusesacoarse-grainedlockingmechanismtoachievehighparallelism.Generally,objectsarelocked.However,ifatransactionwantstoaccessmostinstancesofthesameclass,theentireclassislockedtoensurereliability.Italsoreducesthecostofunlockingthesystem.

OODBSrecoverymechanism

RDBSsupportssoftfailureandhardfailurerecovery.OODBSusestransactionrecoveryfromsoftwarefailuresandaborteduseractivationtransactions,anddoesnotuserecoveryfromdiskfailures.OODBSusestheUNDOlog(theupdatedtargetpageissavedtodiskattheendofthetransaction).Therearemainlytwotypesofrecoverycontent:

(1)Multimedialogrecovery.UsuallyOODBSseparatesmultimediadatafromitsdescriptionpart,andthedescriptionpartreferstothecorrespondingmultimediadatathroughtheobjectidentifier.Thestoragesubsystemmanagesadynamicallychanginglistoffreeblocksinwhichmultimediadataisstored,andthesystemregardsitasamultimediadatalog.Ifthemultimediadatacreationtransactionisaborted,thenonlythedescriptionpartreferenceneedstobeemptiedandthefreeblockchainallocatedtothemultimediadataisreset.Similarly,ifthemultimediadatadeletiontransactionisaborted,thedescriptionpartcanberestoredtotheoriginalstateaccordingtothelog.

(2)Indexpagelogrecovery.Therearetwomethods:①Theinsertoperationofthesplitindexpage.Thesystemallocateshalfoftheentriesofthecurrentindexpagetothenewpage.Exceptfortheentriescopiedtothenewpage,allotherentriesarerecordedinthelog.Intheeventofafailure,simplyremovetheentirenewpage.②Deleteoperationofmergedindexpage.Thesystemcopiestheentriesofthecurrentindexpagetothenewpage.Exceptfortheentriesdeletedfromthecurrentpage,otherentriesarerecordedinthelog.Whenafailureoccurs,thecurrentpagecanbereused.

Virtualtransactions

OODBSsupportstwotypesoftransactions:regulartransactionsandvirtualtransactions.Whentheformerissubmitted,alltheupdateresultsarepermanentlyrecordedinthedatabase;whenitfails,allthechangesareequivalenttonothing.Thelatterisalwayspremature,thatis,nomatterhowthetransactionends,thechangestotheobjectwillnotberecordedinthedatabase.Userscanmakecomplexchangestothedatabasethroughsuchtransactionsandobservetheresultswithoutworryingaboutinconsistencies.Thevirtualtransactionobjectusestwocopies:shadowcopy(originalobject,notupdated)andcurrentcopy(objecttobeupdated).

Longtransactionmanagement

Traditionaltransactionmodehastwoshortcomings:long-termwaitingbetweenconflictingtransactionsanddatabaseupdatecancellationwhenthesystemfails.AlongtransactioninOODBcanberegardedasacollectionofshorttransactions.Ashorttransactionisregardedasthebasicunitofconcurrencycontrolandrecovery,sothatuserscanreducethelockgranularity(turnalongtransactionlockintoashorttransactionlock),andachieveconcurrentoperationsofdifferentlongtransactionsandpartialcancellationoflongtransactions.

Viewclassimplementationtechnology

Object-orienteddatabaseview

Traditionaldatabaseviewreflectsthedatabasefromaspecificangle,anddoesnotstoredata,Doesnottakeupspace,butcanbeoperatedasarealtable,alsoknownasavirtualtable.TheviewsinOODBShavethefunctionsoftraditionaldatabases.Eachviewisa"virtualclass",whichisgeneratedbyoneormoreclasses.Althoughitcannotgenerateobjectinstances,itcanbeoperatedasobjectinstances.Allviewsinanobject-orienteddatabaseconstituteadirectedacyclicgraph,anditsbasicelementistheobjectviewclass.Theobjectviewclassisderivedfromacertainqueryofthesourceclassinthepattern.Itiscomposedofattributesandmethods,andhasinheritanceandcompositionrelationships.

Object-orienteddatabaseviewrealizationtechnology

Manyoperationsinobject-orienteddatabases(suchasstatistics,connectionqueryandviewoperations)canfreelyaccessdatabasedata,UsingtheseoperationstoimplementOODBSviewoperationscanreducecomplexityandimproveefficiency,butitiseasytodestroyobjectencapsulation.Inordernottodestroytheobjectencapsulation,wedesignasetofinterfacesintheobject,andthesystemcompletestheviewoperationthroughthissetofinterfaces,whichwillincreasethecomplexityoftheobjectandthedifficultyofOODBSdesign.Inordertoovercomethisshortcoming,westandardizetheseinterfacesandcombinethemwiththeservicesofotherobjectsinthedatabase.Basedontheaboveconditions,wedesignthecorrespondingdatastructureandoperationstoimplementtheOODBSview.

Aftertheobject-orienteddatabaseviewintegrationtechnologyviewclassisdefined,weintegratethemtogethertoformadirectedacyclicgraph,thebasicelementofwhichistheobjectviewclass.

Versionmanagementtechnology

Thedesignworkinengineeringapplicationsgraduallyevolvesovertime.Ititselfisaprocessofrepetition,trial,selectionandimprovement,duringwhichthesamedesignobjectwillbeproduced.Multipleversions,theymustbemanagedproperly.Inordertoreducethedesigncomplexity,themethodoflayeringandgradualrefinementisoftenused.Inthisway,adesignedobjectiscomposedofmultiplesub-objects,andeachsub-objectalsoproducesmultipleversions.Someversionsofsub-objectstogetherconstituteaspecificversionoftheupper-levelobject,andifanewversioniscreatedforasub-object,theupper-levelobjectmayderiveacorrespondingnewversion,andsoon.Inaddition,intheprocessofpatternevolution,versionmanagementiscommonlyusedtocontroltheevolutionofobjects.Therearetwoaspectstoversionmanagement:

①Collectionmanagement.Forallversionmanagement,therearetwotypesofrelationships,namelychronologicalrelationship,whichisthemostbasicrelationship,whichisgenerallyrepresentedbyversionnumberandderivedrelationship,asshowninFigure2.Thiskindofdiagramiscalledversiondiagram.Versioncollectionmanagementisoftenmanagedbyversionmaps.

②Citationmanagement.Anobjectinamulti-versionsystemisonlyalogicallyvirtualconcept.Whatactuallyexistsiseachversionoftheobject.Therefore,usinganobjectreferstoacertainversionofit.

Generally,therearetworeferencemethods:staticreference(directreferencetoaspecificversionofanobject)anddynamicreference(referencerelationshippointstoacertainobject,notnecessarilywhichversion).Incontrast,dynamicreferencesaremoreeffectiveandclosertoreality.Accordingtowhethertheversionhasbeen"frozen",theversionisdividedintotwotypes:releaseversion(finalizedand"frozen",unchangeable)andprovisionalversion(modifiable).

Securitymodelingtechnology

WiththecontinuousdevelopmentofInternettechnology,securityhasbecomeaproblemthatcannotbeignored.Theuseofsecuritymodelscanaccuratelydescribesystemsecuritypolicies.Thecombinationofsecuritymodelanddatabasesystemisdatabasesecuritymodelingtechnology.OODBusuallydescribesOODBsecuritytechnologyinconjunctionwithRDBsecuritytechnology.CommonlyusedOODBsecuritymodelshavetwomodelsthatsupportsingle-levelandmulti-levelobjects.Incontrast,themulti-levelobjectmodelcanbetterdescribereal-worldentitiesandisthemainstreamtoachieveOODBsecurity.

ThebasicframeworkofsecuritymodelingTheessenceofsecuritymodelingistouseobject-orientedmodelingtechnologytointroduceseveralsecurityconstraintclassificationsforvarioussecurityintherealworld,andperformsecuritygrading.Thesecuritysemanticsisexpressedasasecuritymodelsupportedbythedatabasesystem.Inthisprocess,conflictsmayoccur,causinginconsistenciesindatabasesecuritysemantics.Therefore,consistencydetectionandconflictresolutionarenecessary.Securitymodelinghastwomaintasks:securitygradingandconsistencycheckingandconflictresolution.Thetasksofconsistencycheckingandconflictresolutionarecompletedbythemachine.ThesecuritygradingisprovidedbytheOODBandcompletedbytheapplicationsystemdesigner(modeler).

Advantages

OODBSendowsdatabasedesignersandapplicationdeveloperswithstrongobject-orientedcapabilities,whichgreatlyexpandstheapplicationfieldsofdatabasesystemsandimprovestheworkefficiencyandapplicationsystemsofdevelopersthequalityof.Comparedwiththetraditionaldatamodel,theobject-orienteddatamodelhasadvantagesinthefollowingaspects:

1,easytomaintain

Thestructuredesignedwithobject-orientedthinkinghashighreadability,duetoinheritanceExistence,eveniftherequirementsarechanged,themaintenanceisonlyinpartialmodules,soitisveryconvenientandlow-costtomaintain.

2,highquality

Whendesigning,youcanReuseexistingclassesthathavebeentestedinthefieldofpreviousprojectstomakethesystemmeetbusinessneedsandhaveahigherquality.

3,highefficiency

Duringdevelopment,thereal-worldthingsareabstractedaccordingtotheneedsofthedesign,andclassesaregenerated.Usingsuchamethodtosolveproblems,closetodailylifeandnaturalthinking,isboundtoimprovetheefficiencyandqualityofsoftwaredevelopment.

4.Easytoexpand

Duetothecharacteristicsofinheritance,encapsulation,andpolymorphism,asystemstructurewithhighcohesionandlowcouplingisnaturallydesigned,whichmakesthesystemmoreflexible,easiertoexpand,andlowercost.

Problem

Object-orienteddatabasetechnologyisexpectedtobecomeanewgenerationofdatamanagementtechnologyafterrelationaldatabasetechnology.Althoughtherehasbeenalotofresearchanddevelopmentwork,therearesomesupportedobject-orientedDatabasesystems,butthematurityofobject-orienteddatabasesstilldependsonthesolutionofmanykeyissues.Ontheotherhand,sincethedevelopmentofobject-orienteddatabaseshasgonethroughtheprocessfromresearchtocommercialuse,developersarefacedwithtechnologiesthatinvolvevariousaspectsProblem.Forobject-orienteddatabases,thebiggestchallengeistobuildadatabasewithexcellentperformance,consistency,integrity,reliabilityandflexibility.Someoftheseproblemsareuniquetoobject-orienteddatabases,suchas:

  1. Performance:Sincedatainobject-orienteddatabasesisstoredinmanyplaces,effectiveobjectaggregationisakeyfactorinperformance.ThiskindofdataaggregationcanbebasedontheclasslevelorotherobjectsRelationsarethebasis.Theperformanceimprovementofobject-orienteddatabasesalsorequiresanexcellentcachesolution.Thegoalistoputobjectstogetherasmuchaspossibleaccordingtotherequirementsofuse.Atthesametime,object-orienteddatabasetechnologyshouldreplacetraditionaldatabasetechnology.Performanceimprovementisessential.Onewaytoimprovetheperformanceofobject-orienteddatabases,especiallyinadistributedenvironment,istotreattheapplicationsthataccessthedatabaseasobjects,sothattheycanlooklikedataobjectsinthedatabase.Movearoundlikethat.Wheninquiring,thedatabasecanchoosetomovethedatatotheprogramormovetheprogramtothedata.

  2. Modificationofthepattern:Whenanobject-orienteddatabaseupgradeornewModificationorreconstructionofthedatabaseschemaduringtheversionwillbeaproblem.Theobject-orienteddatamodelhasrichmodelingcapabilities,whichmakesiteasyforuserstomodel.Ontheotherhand,italsomakestheobject-orienteddatabaseschemacomplexandrequirestoolsupport.Views,Deductiveability,semanticmodelingandlongtransactionsarealsothedatabasesthatfutureobject-orienteddatabasesystemsshouldhavefeature.Scalablearchitectureisalsoanimportantdirection.

  3. Standardization:Standardizationandformalizationareanimportantdirectionfortheresearchanddevelopmentofobject-orienteddatabasesystems.Inthepastfewyears,peoplehavebasicallyreachedaconsensusonthecoreobject-orientedconcepts,buttheunderstandingofotheraspectsoftheobject-orienteddatamodel,suchas&architecture,programminginterfacelanguagehasnotyetreachedconsensus.Needtobestandardizedinthesystemdevelopmentandapplicationprocess.

Latest: Distinguished Professor

Next: National Economic and Social Development Plan