Evolutionary Database Design.docx

上传人:b****7 文档编号:9096251 上传时间:2023-02-03 格式:DOCX 页数:9 大小:30.38KB
下载 相关 举报
Evolutionary Database Design.docx_第1页
第1页 / 共9页
Evolutionary Database Design.docx_第2页
第2页 / 共9页
Evolutionary Database Design.docx_第3页
第3页 / 共9页
Evolutionary Database Design.docx_第4页
第4页 / 共9页
Evolutionary Database Design.docx_第5页
第5页 / 共9页
点击查看更多>>
下载资源
资源描述

Evolutionary Database Design.docx

《Evolutionary Database Design.docx》由会员分享,可在线阅读,更多相关《Evolutionary Database Design.docx(9页珍藏版)》请在冰豆网上搜索。

Evolutionary Database Design.docx

EvolutionaryDatabaseDesign

EvolutionaryDatabaseDesign

Overthelastfewyearswe'vedevelopedanumberoftechniquesthatallowadatabasedesigntoevolveasanapplicationdevelops.Thisisaveryimportantcapabilityforagilemethodologies.Thetechniquesrelyonapplyingcontinuousintegrationandautomatedrefactoringtodatabasedevelopment,togetherwithaclosecollaborationbetweenDBAsandapplicationdevelopers.Thetechniquesworkinbothpre-productionandreleasedsystems.

January2003

MartinFowler

PramodSadalage

Translations:

JapaneseRussian

Contents

∙DealingwithChange

oLimitations

∙ThePractices

oDBAscollaboratecloselywithdevelopers

oEverybodygetstheirowndatabaseinstance

oDevelopersfrequentlyintegrateintoasharedmaster

oAdatabaseconsistsofschemaandtestdata

oAllchangesaredatabaserefactorings

oAutomatetherefactorings

oAutomaticallyUpdateallDatabaseDevelopers

oClearlyseparatealldatabaseaccesscode

∙Variations

oKeepingmultipledatabaselineages

oYoudon'tneedaDBA

∙ToolstoHelp

∙FurtherStepsandFurtherInformation

Inthelastfewyears,we'veseentheriseofanewbreedofsoftwaremethodologies,theagilemethodologies.Thesemakesomenewandsignificantdemandsondatabasedesign.Oneofthemostcentralofthesedemandsistheideaofevolutionarydesign.Onanagileprojectyouassumethatyoucannotfixtherequirementsofthesystemup-front.Asaresulthavingadetaileddesignphaseatthebeginningofaprojectbecomesimpractical.Thedesignofthesystemhastoevolvethroughthevariousiterationsofthesoftware.Agilemethods,inparticularextremeprogramming(XP),haveanumberofpracticesthatmakethisevolutionarydesignpractical.

Manypeoplehavequestionedwhetherevolutionarydesigncanbeappliedtoasystemwithalargedatabasecomponent.Indeedmanypeopletoldusthatitwasimpossible-atroublingthoughtasThoughtWorksembarkedonalargedatabase-orientedprojectusingmanyagileandXPtechniques.

Thisarticledescribesthepracticesthatwe'veusedtoallowustodothisimpossiblething.Wewon'tsaythatwe'vecompletelysolvedthedatabaseevolutionproblem,butwedothinkwe'vedemonstratedasetoftechniquesthatmanypeoplewillfinduseful.

DealingwithChange

Oneoftheprimaryfeaturesofagilemethodsistheirattitudetowardschange.Mostofthethinkingaboutsoftwareprocessisaboutunderstandingrequirementsearly,signingoffontheserequirements,usingtherequirementsasabasisfordesign,signingoffonthat,andthenproceedingwithconstruction.Thisisaplan-drivencycle,oftenreferredto(usuallywithderision)asthewaterfallapproach

Suchapproacheslooktominimizechangesbydoingextensiveup-frontwork.Oncetheearlyworkisdone,changescausesignificantproblems.Asaresultsuchapproachesrunintotroubleifrequirementsarechanging,andrequirementschurnisabigproblemforsuchprocesses.

Agileprocessesapproachchangedifferently.Theyseektoembracechange,allowingchangestooccurevenlateinadevelopmentproject.Changesarecontrolled,buttheattitudeoftheprocessistoenablechangeasmuchaspossible.Partlythisisinresponsetotheinherentinstabilityofrequirementsinmanyprojects,partlyitistobettersupportdynamicbusinessenvironmentsbyhelpingthemchangewiththecompetitivepressures.

Inordertomakethiswork,youneedadifferentattitudetodesign.Insteadofthinkingofdesignasaphase,whichismostlycompletedbeforeyoubeginconstruction,youlookatdesignasanon-goingprocessthatisinterleavedwithconstruction,testing,andevendelivery.Thisisthecontrastbetweenplannedandevolutionarydesign.Oneofthevitalcontributionsofagilemethodsisthattheyhavecomeupwithpracticesthatallowevolutionarydesigntoworkinacontrolledmanner.Soinsteadofthecommonchaosthatoftenhappenswhendesignisn'tplannedup-front,thesemethodsprovidetechniquestocontrolevolutionarydesignandmakethempractical.

Animportantpartofthisapproachisiterativedevelopment,whereyouruntheentiresoftwarelife-cyclemanytimesduringthelifeofaproject.Agileprocessesruncompletelifecyclesineachiteration,completingtheiterationwithworking,tested,integratedcodeforasmallsubsetoftherequirementsofthefinalproduct.Theseiterationsareshort,usuallyrunningbetweenaweekandacoupleofmonths,withapreferencetowardsshorteriterations.

Whilethesetechniqueshavegrowninuseandinterest,oneofthebiggestquestionsishowtomakeevolutionarydesignworkfordatabases.Mostpeopleconsiderthatdatabasedesignissomethingthatabsolutelyneedsup-frontplanning.Changingthedatabaseschemalateinthedevelopmenttendstocausewide-spreadbreakagesinapplicationsoftware.Furthermorechangingaschemaafterdeploymentresultinpainfuldatamigrationproblems.

Overthecourseofthelastthreeyearswe'vebeeninvolvedinalargeproject(calledAtlas)thathasusedevolutionarydatabasedesignandmadeitwork.Theprojectinvolvedalmost100peopleinmultiplesitesworld-wide(US,Australia,andIndia).Itisaroundhalfamillionlinesofcodeandhasover200tables.Thedatabaseevolvedduringayearandahalfofinitialdevelopmentandcontinuestoevolveeventhoughit'sinproductionformultiplecustomers.Duringthisprojectwestartedwithiterationsofamonth,butafterafewmonthschangedtotwoweekiterationswhichworkedbetter.Thetechniqueswedescribeherearetheonesthatwe(ormoreaccuratelyPramod)usedtomakethiswork.

Sincethatprojectgotgoingwe'vespreadthesetechniquesovermoreofourprojects,gainingmoreexperiencefrommorecases.We'vealsofoundinspiration,ideas,andexperiencefromotheragileprojects.

Limitations

Beforewediveintothetechniques,it'simportanttostatethatwehaven'tsolvedalltheproblemsofevolutionarydatabasedesign.Inparticular:

∙Wedevelopedanapplicationdatabaseforasingleapplicationratherthananintegrationdatabasethattriestointegratemultipledatabases.

∙Wedon'thavetokeeptheproductiondatabasesup24/7

Wedon'tconsidertheseproblemstobeinherentlyunsolvable,afterallmanypeoplebelievedwecouldn'tsolvethisone.Butuntilwedo,wewon'tclaimwecansolvethemeither.

ThePractices

Ourapproachtoevolutionarydatabasedesigndependsonahandfulofimportantpractices.

DBAscollaboratecloselywithdevelopers

Oneofthetenetsofagilemethodsisthatpeoplewithdifferentskillsandbackgroundsneedtocollaborateverycloselytogether.Theycan'tcommunicatemainlythroughformalmeetingsanddocuments.Insteadtheyneedtobeouttalkingwitheachotherandworkingwitheachotherallthetime.Everybodyisaffectedbythis:

analysts,PMs,domainexperts,developers...andDBAs.

EverytaskthatadeveloperworksonpotentiallyneedsaDBA'shelp.BoththedevelopersandtheDBAneedtoconsiderwhetheradevelopmenttaskisgoingtomakeasignificantchangetothedatabaseschema.IfsothedeveloperneedstoconsultwiththeDBAtodecidehowtomakethechange.Thedeveloperknowswhatnewfunctionalityisneeded,andtheDBAhasaglobalviewofthedataintheapplication.

TomakethishappentheDBAhastomakehimselfapproachableandavailable.Makeiteasyforadevelopertojustpopoverforafewminutesandasksomequestions.MakesuretheDBAsanddeveloperssitclosetoeachothersotheycaneasilygettogether.EnsurethatapplicationdesignsessionsareknownaboutsotheDBAcanpopineasily.InmanyenvironmentsweseepeopleerectingbarriersbetweentheDBAandapplicationdevelopmentfunctions.Thesebarriersmustcomedownforanevolutionarydatabasedesignprocesstowork.

Everybodygetstheirowndatabaseinstance

Evolutionarydesignrecognizesthatpeoplelearnbytryingthingsout.Inprogrammingtermsdevelopersexperimentwithhowtoimplementacertainfeatureandmaymakeafewattemptsbeforesettlingdowntoapreferredalternative.Databasedesigncanbelikethattoo.Asaresultit'simportantforeachdevelopertohavetheirownsandboxwheretheycanexperiment,andnothavetheirchangesaffectanyoneelse.

ManyDBAexpertsseemultipledatabasesasanathema,toodifficulttoworkinpractice,butwe'vefoundthatyoucaneasilymanageahundredorsodatabaseinstances.Thevitalthingistohavetotoolstoallowyoutomanipulatedatabasesmuchasyouwouldmanipulatefiles.

Developersfrequentlyintegrateintoasharedmaster

Althoughdeveloperscanexperimentfrequentlyintheirownarea,it'simportanttobringthedifferentapproachesbacktogetheragainfrequently.Anapplicationneedsasharedmasterdatabasethatallworkflowsfrom.Whenadeveloperbeginsatasktheycopythemasterintotheirownworkspace,manipulate,andthenintegratetheirchangesbackintothemaster.Asaruleofthumbeachdevelopershouldintegrateonceaday.

Let'stakeanexamplewhereMikestartsadevelopmenttaskat10am(assumingheactuallycomesinthatearly).Aspartofthistaskheneedstochangethedatabaseschema.Ifthechangeiseasy,likeaddingacolumn,hejustdecideshowtomakethechangehimself,Mikealsomakessurethecolumnhewantstoadddoesnotalreadyexistinthedatabase,withthehelpofthedatadictionary(discussedlater).Ifit'smorecomplicatedthenhegrabstheDBAandtalksoverthelikelychangeswithhim.

Oncehe'sreadytobeginhetakesacopyofthedatabasemasterandcanmodifyboththedatabaseschemaandcodefreely.Ashe'sinasandboxanychangeshemakesdon'timpactanyoneelse's.Atsomepoint,sayaround3pm,he'sprettycomfortablethatheknowswhatthedatabasechangeneedstobe,ev

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > PPT模板 > 中国风

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1