Dat
ast
ruct
ures
Twof
undament
alcomponent
sofDat
aSt
ruct
ure
1.Or
gani
zati
on
- Ref
erst
othewayr ecordsarephysi
cal
l
yar
rangedont
hesecondar
yst
oragedev
ice.
Thi
smaybeei
thersequenti
alorr
andom.
Sequenti
alf i
les-therecor
dsinsequenti
alfi
lesar
estor
edincontiguousl ocat
ionsthatoccupy
aspecifi
edar eaofdiskspace.
Random f i
les-recor
dsinrandom fi
lesarestor
edwit
houtregardfortheirphysicalr
elat
ionshi
p
tootherrecordsofthesamef i
le.Random f
il
esmayhaverecordsdist
ributedthroughoutadisk.
2.Accessmethod
- isthetechniqueusedtolocaterecor
dsandt onav
igat
et hr
oughthedatabaseorf
il
e.
Whileseveralspeci
fi
ctechni
quesareused,i
ngeneral
,theycanbeclassi
fi
edaseit
her
dir
ectaccessorsequenti
alaccessmethods.
Fl
at -Fi
leSt r
uct ur
es
-fl
at-fi
l
emodeldescr ibesanenv i
ronmentinwhichi ndivi
dualdat
af i
l
esar enotintegratedwit
h
otherf i
les.Enduser sinthi
senvironmentowntheirdatafi
lesr at
herthansharethem withotherusers.
Dat apr ocessingist husperf
ormedbyst andal
oneappl i
cat i
onsr at
herthanint
egratedsy stems.The
fl
at-fil
eappr oachi sasi ngl
ev iew modelthatcharacter
izesmanyl egacysystems.Dat afilesar
e
structured,formatted,andarr
angedt osui
tthespecif
icneedsoft heownerorprimaryuser .
Sequenti
alSt
ructure-t
hesequenti
alstr
uctur
e,whi
chistypical
lycal
l
edthesequent i
alaccessmet hod.
Underthi
sarr
angement ,f
orexample,t
herecordwi
thkeyv alue1875ispl
acedint hephysicalstor
age
spaceimmediatelyfol
lowingtherecordwithkeyvalue1874.Thus,al lrecordsi nthef il
el i
ein
conti
guousstoragespacesinaspeci fi
edsequence(ascendingordescending)ar r
angedbyt heir
pri
marykey.
IndexedSt r
ucture-Anindexedst r
uctureissonamedbecause, inaddit
iontotheact
ualdatafi
le,t
hereexist
sa
separateindexthatisitselfafil
eofr ecordaddresses.Thisi
ndexcontainst
henumericvalueofthephy si
cal
diskstoragelocati
on(cy l
i
nder,surface,andrecordblock)f
oreachrecordint
heassociat
eddat afi
le.Thedata
fil
eit
selfmaybeor ganizedeithersequential
l
yorr andomly.
I
ndexedrandom fil
e-recordsinanindexedrandom f
il
ear
edisper
sedt
hroughoutadi
skwit
houtregar
d
f
orthei
rphy si
calproximit
yt ootherrel
atedrecor
ds.Inf
act
,recor
dsbelongi
ngtothesamefil
emay
r
esi
deondi f
ferentdi
sks.
Virt
ualstor
ageaccessmethod(VSAM)-isusedf orv er
ylar
gef i
lesthatrequi
rer
outi
nebatch
processi
ngandamoder atedegreeofindi
vidualrecordprocessing.TheVSAM struct
ureis
usedforlar
gefi
l
esthatof
tenoccupysev
eralcyli
ndersofconti
guousst or
ageonadisk.
A disadvant
ageoft heVSAM str
uctureisthati
tdoesnotper for
mr ecor
di nser
ti
onoperat
ions
(Operati
on2)effi
cientl
y.Onemethodofdealingwit
hthi
spr obl
em istost orenew recor
dsinan
overfl
owareathati
sphy si
cal
l
yseparat
efrom t
heot
herdat
arecordsinthefil
e.
HashingStructur
e-ahashingstructureemploy
sanalgorit
hm t hatconv
ert
stheprimarykeyofa
recorddi
rectl
yint
oast or
ageaddr ess.Hashi
ngeli
minatestheneedf orasepar
ateindex.By
calcul
ati
ngtheaddress,r
athert
hanr eadingi
tfr
om anindex,recordscanberetr
iev
edmor equi
ckl
y.
• Thepr i
ncipaladvantageofhashi ngi saccessspeed.Cal cul
atingar ecord’
saddr essi
sf ast
er
thansearchingforitthroughani ndex.
• Thehashi ngst r
uctur ehast wodi sadvantages.Fir
st,thistechniquedoesnotusest orage
spaceeffi
cientl
y.Theseconddi sadvantageisthereverseofthef i
rst
.Differ
entrecordkeysmay
generat
et hesame( orsimilar)resi
dual,whichtransl
atesintothesameaddr ess.Thisi
scal l
ed
acoll
isi
onbecauset wor ecordscannotbest or
edatthesamel ocati
on.
Point
erStr
uctures-thepointerstruct
ureisusedtocreateal i
nked-l
istfi
l
e.Thisapproachstoresi
na
fi
eldofonerecordtheaddr ess(point
er)ofarel
atedrecord.Therecordsint
histypeoffil
earespread
overtheentir
edi skwithoutconcer nf orthei
rphysicalproxi
mitywi t
hotherrelat
edr ecords.The
point
erspr
ovideconnectionsbetweent herecor
ds.
Poi
nter
smayal
sobeusedt
oli
nkr
ecor
dsbet
weenf
il
es.
Ty
pesofPoi
nter
s
Phy sicaladdr esspointer-itcontainstheact ualdiskstoragel ocation(cy
linder,surf
ace,and
recor dnumber )neededbyt hedi skcont rol
ler.Thi
sphy sicaladdr essall
owst hesy st
em to
accesst herecorddir
ectlywi t
houtobtainingfurtheri
nfor
mat ion.
Relat i
veaddr esspointer-itcontainsther el
ativ
epositi
onofar ecordi nt
hefile.
Logi calkeypoi nter
-itcont ai
nst hepr i
mar ykeyoft herelatedr ecord.Thiskeyv alueisthen
conv ertedintotherecord’sphy si
caladdressbyahashi ngal gori
thm.
Hi
erar
chi
calandNet
wor
kDat
abaseSt
ruct
ures
Fl
atf ilesy stem-exi stasindependentdat astr
ucturesthatar
enotl i
nkedlogicall
yorphy si
call
yt o
otherf i
l
es.
Dat abasemodel s-wer edesignedt osuppor tf
lat
-fi
lesystemsal
readyinplace,whi leall
owingt he
organi zationt omov etonewl evel
sofdat aint
egrat
ion.
Hier archicalDat abaseModel-i sadat abasemodeli nwhicht
hedat aareorganizedintoatree-l
ike
struct ure.
Net wor kDat abasemodel -isadat abasemodelconcei v
edasaf l
exibl
ewayofr epresent
ingobjects
andt heirrelati
onship.