Contents
- 格式:pdf
- 大小:99.02 KB
- 文档页数:17
TransactionalStore
SoftwareDesignDocument
Version1.0
HarishG.Naik
April15,2007Contents
1Introduction2
2SystemOverview3
3DesignConsideration4
3.1AssumptionsandDependencies...................4
3.2GeneralConstraints.........................4
3.3GoalsandGuidelines.........................4
3.4DevelopmentMethods........................4
4ArchitecturalStrategies5
5SystemArchitecture6
5.1SubsystemArchitecture.......................6
6PoliciesandTactics7
7DetailedSystemDesign8
7.1RecoveryProgram..........................8
7.2ServerProgram............................9
7.3Library................................10
7.4DetailedSubsystemDesign.....................12
8Glossary14
9Bibliography15
1Chapter1
Introduction
ThisistheSoftwareDesignDocumentfortheTransactionalStore.Thedocu-
mentcoversbriefanddetaileddesignofthesoftware.Theintendedaudience
arethecourseinstructorandtheTeachingAssistant.Thedocumentcanalso
beusedtounderstandthecorecomponentsandtheirfunctioningbyanyone
whointendstoextendthegivenapplication.
2Chapter2
SystemOverview
Thesoftwareattemptstoimplementatransactionalstoresystem.Thesystem
consistsofvariouscomponentsincludingthelibrarycalledlibtransaction.a
andincludefilecalledtransaction.handotherserversmeantformonitorand
recovery.
3Chapter3
DesignConsideration
ThesoftwarewillprovidetheACID(AtomicityConsistencyIsolationDurability)
properties.
3.1AssumptionsandDependencies
•Thesoftwareisdesignedtorunonx86machinesrunningtheGNU/Linux
OperatingSystem
•Thesoftwarewillbeavailableassource.Itwillcompileintobinariesand
alibrary.Theapplicationprogrammerwillhavetousetheincludefile
transaction.htousethesoftware.
3.2GeneralConstraints
•LackofcompleteunderstandingoftheUnixI/Osystem
•Shorttime
3.3GoalsandGuidelines
•Keepitsimplestupid
•Thesoftwareinitsfirstversionisnotmeanttobeefficientwithrespect
performancebutemphasizesproperworking
3.4DevelopmentMethods
DifferentapproachesofimplementationlikeCentralizedsystemandDecentral-
izedsystemwereconsidered.Butthecentralizedschemewaschosen.
4Chapter4
ArchitecturalStrategies
Acentralizedschemewaschosenoveradecentralizedschemesincethisscheme
wouldallowbettermanagementoflocks.Acentralizedserverwouldmanage
locksandgrantpermissionstoread/write(performI/O)onthesamestorefile.
Thishelpsbetterhandlingofdeadlocksandstarvation.
Howeverthefollowingaretheissues/benefitswithrespecttothecentralized
design:
1.Thereisacentralserverthatmanagestransactionsbymaintainingatrans-
actionqueue
2.Eachclientprocessneedtomakeconnectionstothisserverandsend
transactiondetailsusingadefineddatastructure
5Chapter5
SystemArchitectureThesystemisdesignedtoprovideflattransactions(1)asshown:
NULLactive
abortedcomittedterminateterminateROLLBACK
WORK
COMMIT
WORK
5.1SubsystemArchitecture
Theentiresystemiscomposedoffoursubsystems:
•recoveryprogramthatuseslogstobringthesystemtoaconsistentstate
•serverprogramwritingtothestoreandwritinglogsmakingcallstothe
library
•libraryprovidingallthelow-levelfunctionality
•clientprograminteractingwiththeserverprogram
6Chapter6
PoliciesandTactics
NotApplicable
7Chapter7
DetailedSystemDesign
Thissectionwilldescribethedesignofthesoftwareindetailbybreakingitdown
intoindependentcomponentsanddescribingindetailtheirdesign,behaviorand
interactionswiththesurroundings.
Wenowconsidereachofthesecomponentsindetail:
7.1RecoveryProgram
Therecoveryprogramisthefirstthatisinvokedonstartofthetransactional
store.
Classification
Thisisasubsystem,thatisinvokedatthestart.
Definition
Therecoveryprogramisthepartoftheapplicationthatexecutedrightatthe
beginningofasystemsetupandwhichrestoresthesystemtoaconsistentstate.
Responsibilities
Theresponsibilityofarecoveryprogramistorestorethestorethethelast
consistentstate.
Constraints
NA
Composition
Therecoveryprogrammakesuseofalogindexanumberoflogfiles.
8Users/Interactions
Theonlyinteractiontheuserhaswiththissubsystemisstartingtherecov-
eryprocess.Therecoveryprogramloadsdatafromthelogfilesandmakes
appropriatelibrarycalls.
Resources
Therecoveryprogramneedsaccesstothelogindex.Basedontheentriesit
checksstatusofeachlog.
Processing
Theprogramstartsbyreadingthethefilelogs/translogwhichisthelog
index.Theindexhasanumberofentrieswhicharenamesoflogfiles.These
logfilescorrespondtothetransactionsthathaveneitherdoneacommitnora
revoke.Onsuccessfulrecoveryfromallthelogfiles,theprograminvokesthe
server.
Interface/Exports
Nointerfaceisexported.
7.2ServerProgram
Iftherecoverysucceedsandthestorereturnstoconsistentstate,therecovery
programlaunchestheserverprogram.
Classification
Thisisthecentralprogramoftheapplication.
Definition
Responsibilities
Theserveristhecomponentoftheaplicationthatdoesthemaintaskslike
issuingtransactionid,queingtransactions;applyingandreleasingoflocks,per-
formingreadandwriteandwritingtologfile.
Constraints
NA
Composition
Consistsofthetransactionqueuemanager,lockmanager,fewinternalmethods
thatsetuprequiredconditionsbeforecallinglibraryroutines,logfiles.
Users/Interactions
Interactswiththeclientandqueuesrequests,updatesstoreandupdateslog.