Data pattern

Mode

Definition:Alsocalledlogicalmode,itisthedescriptionofthelogicalstructureandcharacteristicsofalldatainthedatabase,andisthecommondataviewforallusers.

Understanding:

①Adatabasehasonlyonemode;

②Itistheviewofdatabasedataatthelogicallevel;

③DatabaseThemodeisbasedonacertaindatamodel;

④Whendefiningthemode,itisnotonlynecessarytodefinethelogicalstructureofthedata(suchaswhichdataitemsconstitutethedatarecord,thename,type,valuerangeofthedataitem,etc.),Anddefinethesecurityandintegrityrequirementsrelatedtothedata,anddefinetherelationshipbetweenthesedata.

ExternalSchema

Definition:alsoknownasSubschemaorusermode,whichcanbeseenandusedbydatabaseusers(includingapplicationprogrammersandendusers)Thedescriptionofthelogicalstructureandcharacteristicsofthelocaldataisthedataviewofthedatabaseuserandthelogicalrepresentationofthedatarelatedtoacertainapplication.

Understanding:

①Adatabasecanhavemultipleexternalmodes;

②Theexternalmodeistheuserview;

③TheexternalmodeItisapowerfulmeasuretoensuredatasecurity.

InternalSchema

Definition:alsoknownasStorageSchema,itisthedescriptionofthephysicalstructureandstorageofdata,andtherepresentationofdatainthedatabase(Forexample,isthestoragemethodofrecordsstoredsequentially,storedinaB-treestructure,orstoredinahashmethod;howtheindexisorganized;whetherthedataiscompressedandstoredandwhetheritisencrypted;whataretherequirementsforthestoragerecordstructureofthedata).

Understanding:

①Adatabasehasonlyoneinternalschema;

②Atablemayconsistofmultiplefiles,suchasdatafilesandindexfiles.

Itisamethodforthedatabasemanagementsystem(DBMS)toeffectivelyorganizeandmanagethedatainthedatabase

Itspurposeis:

①Inordertoreducedataredundancy,Realizedatasharing;

②Inordertoimproveaccessefficiencyandperformance.

SchemaInterpretation(ConceptualSchema)

ConceptualSchemaisthedescriptionoftheglobaldatalogicalstructureinthedatabasesystem,andisthecommondataviewofallusers(applications).ThisdescriptionisanabstractionThedescriptionof,itdoesnotinvolvespecifichardwareenvironmentandplatform,andhasnothingtodowithspecificsoftwareenvironment.

Theconceptualmodelmainlydescribestheconceptualrecordtypeofdataandthedataandtherelationshipbetweenthem.Italsoincludessomesemanticconstraintsbetweenthedata.ItsdescriptioncanbedefinedbytheDDLlanguageintheDBMS.

ExternalSchema

ExternalSchemaisalsocalledSubschemaorUser'sschema.Itistheuser’sdataview,thatis,theuser’sApartoftheseenpatternisderivedfromtheconceptualpattern.Theconceptualpatterngivesaglobaldatadescriptionofthesystemandtheouterpatterngivesalocaldescriptionofeachuser.Aconceptualmodecanhaveseveralexternalmodes,andeachuseronlycaresaboutthemoderelatedtoit.Thiscanshieldalargeamountofirrelevantinformationandisbeneficialtodataprotection,soitisextremelybeneficialtousers.IngeneralDBMS,therearerelatedexternalmodedescriptionlanguages​​(externalmodeDDL).

InternalSchema

InternalSchemaisalsocalledPhysicalSchema,whichgivesDatabasephysicalstoragestructureandphysicalaccessmethods,suchasdatastoragefilestructure,index,clusteringandhashaccessmethodsandaccesspaths.Thephysicalityoftheinternalmodeismainlyreflectedintheoperatingsystemandfilelevel.Deepdowntothedevicelevel(suchasdiskanddiskoperations),butinrecentyearstherehasbeenatrendtowardthedevicelevel(suchasrawdisk,diskblocktechnology,etc.),DBMSgenerallyprovidesrelatedinternalmodedescriptionlanguage(internalmodeDDL).

Thedatamodelgivesthedataframestructureofthedatabase,andthedatainthedatabaseistherealentity,butthesedatamustbeorganizedaccordingtothestructuredescribedbytheframework,andthedatabasecomposedoftheconceptualmodelastheframeworkCalledConceptualDatabase,adatabasecomposedofaframeworkwithanexternalmodeliscalledauserdatabase,andadatabasecomposedofaframeworkwithaninternalmodeliscalledaphysicaldatabase.Amongthethreedatabases,onlythephysicaldatabaseisreal.Existinthecomputer'sexternalmemory,theothertwodatabasesdonotreallyexistinthecomputer,butaremappedfromthephysicaldatabasethroughtwomappings.

Thethreelevelsofthemodelreflectthethreedifferentenvironmentsofthemodelandtheirdifferentrequirements.Theinternalmodelisatthelowestlevel.Itreflectstheactualstorageformofthedatainthephysicalstructureofthecomputer,theconceptualmodelInthemiddlelayer,itreflectsthedesigner'sdatagloballogicrequirements,whiletheoutermodeisintheoutermostlayer,whichreflectstheuser'sdatarequirements.

Thethree-levelmodeofthedatabasesystemisanabstractionofthethreelevelsofdata.Itleavesthespecificphysicalrealizationofthedatatothephysicalmode,sothatusersandglobaldesignersdonotneedtocareaboutthespecificrealizationandphysicalbackgroundofthedatabaseAtthesametime,itestablishestheconnectionandconversionbetweenthethree-levelmodelthroughtwo-levelmapping,sothatalthoughtheconceptualmodelandtheexternalmodeldonothaveaphysicalexistence,theycanalsoobtaintheirexistingentitiesthroughthemapping.Atthesametime,thetwo-levelmappingalsoensuresthedatabaseTheindependenceofthedatainthesystem,thatis,changesinthephysicalorganizationofthedataandchangesinthelogicalconceptlevel,doesnotaffectthechangesintheexternalmodeoftheuser.Itonlyneedstoadjustthemappingmodewithoutchangingtheusermode.

Mappingfromconceptualmodetointernalmode

Thismappinggivesthecorrespondencebetweenthegloballogicalstructureofthedataintheconceptualmodeandthephysicalstoragestructureofthedata.ThismappingisgenerallydefinedbyDBMSimplementation.

Mappingfromexternalmodetoconceptualmode

Conceptmodeisaglobalmodeandexternalmodeisauser'slocalmode.Aconceptualmodecandefinemultipleexternalmodes,andeachTheexternalmodeisabasicviewoftheconceptualmode.Themappingfromtheexternalmodetotheconceptualmodegivesthecorrespondingrelationshipbetweentheexternalmodeandtheconceptualmode,andthismappingisgenerallyimplementedbyaDBMS.

Related Articles
TOP