Академический Документы
Профессиональный Документы
Культура Документы
Allcompanyorproductnamesmentionedhereinare trademarksoftheirrespectiveowners.
AWhitePaper
ByArjunSinha
TwoPhaseCommitPowerofIBMFederationServer
Introduction
Thispaperintroducestheefficiency/effectivenessofTwoPhaseCommitofIBMsDB2Federation Server.Itdealson;HowaCommitexecutedonsourcesystemmanagesthetransactiononheterogeneous targetinstanceusingtheFederationServerlayerofIBMDB2.Italsocoversoneusecasetoprovidecloser lookofsame.
TransactionSystemwithDistributedDatabaseArchitecture:
Today'stransactionprocessingincreasinglyrequiressupportfortransactionsthatspananetworkand mayincludemorethanonetargetinstance. WhenwesayTargetInstancethatmeansitisverypossiblewhenUserfiresacommitonone subjectareaandthenitmayhavetoperformoperationonmultiplephysicaldatabasesystems. OLTPsoftwareusesclient/serverprocessingandbrokeringapplicationsoftwarethatallows transactionstorunondifferentcomputerplatformsinanetwork.Andthisalltakecareby Application. Sometime&somewayit'sbigdealforApplicationtomaintainasingletransactionwhichhasto performonmultipletargetinstance(HeterogeneousTargetSystem).
TwoPhaseCommitPowerofIBMFederationServer
ImplementationStrategy
Beforeapplyingthisconceptonanysystem,thesystemanalysisshouldinvolveidentifyingtheFeasibility Studyfirst.Someoftheimportantpointscanbecoveredasbelow: Ifapplicationisheavilyloadedwithprocessingtohandlenumberofrequestwhilelisting& sendingthemessagestogetproperacknowledgmentfromheterogeneoussystemforanupdateof source. Forexample,anETL(ExtractionTransform&Loading)tool(asApplicationlayer)isdealingwith1 Insert/updateofsourcetabletorefreshonitsheterogeneoustargetinstance. Ifrealtimeaccessofthedifferentsystemisneeded,andthisisalsopossiblewhensizeof distributeddatabasesisverylarge&itisdifficulttomaintainalldatainoneserverarchitecture.
ThenitsgoodpointtolookaheadandimplementthisTwoPhaseCommitadvantageofFederationServer.
NearbyAdvantages:
FederationserverwithTWOPHASECOMMITenabledwillbeabletohandlecommitexecution for: a) WhensystemhasheterogeneousSource&TargetinstanceslikecombinationofXML, RDBMS,FlatFilesorWebService. b) WhenusersareusingBusinessintelligencedashboardwhichextractsdatafrom heterogeneoussource/targetsystems. c) Whenoneofthenodesfailsoutofdifferentsource/targetsystemnodes.Itisvery importanttogetdisasterresponsefromthefailednode.Federationservermanagesthis dataveryconsistentlyusingTwoPhaseCommit. d) Whenextractioninvolvestoomanyextractionrulesandgetsthedeadlocksituation.It managesthisdeadlocksituationalsoveryeffectively.
TwoPhaseCommitPowerofIBMFederationServer
TransactionProcessingwithSimpleCommit
DiagramA
LetusunderstandbelowmentioneddiagramtogetmorecloselytoSimpleCommitofany transactionprocessingsystem. Thisdiagramshowsatransactionprocessingsystemreadingsourcedataforaninsertorupdate, andtryingtorefreshthesameinitscorrespondingtargetinstances. WhereTargetinstanceisheterogeneoussystemofOracle,SQLServer&DB2.
TwoPhaseCommitPowerofIBMFederationServer
TwoPhaseCommitPowerofIBMFederationServer
DiagramB
NowletsseeadifferentlookofsamescenariobutusingTwoPhaseCommit. Insamewayatransactionsystemhasgotsource&heterogeneoustargetinstance. ApplicationfiresCommitforanyinsertorupdateontarget(submitCommitrequest)at applicationlayertoFederationServer(WhereFederationserverhasgotTwoPhaseCommit Enabled).
TwoPhaseCommitPowerofIBMFederationServer
TwoPhaseCommitPowerofIBMFederationServer
UsedCase(CustomerScenario)
AsofnowwehaveseenconceptualknowledgeofTwoPhaseCommitofFederationServer;nowlets understandsamewithonerealtimeexampleandwithtoolinterface. BelowmentionedtableDiagramshowsanexampleofSourcetablechangestoitstargettable instances. AnapplicationhasgotasourceCustomerDatainFlatFilestructure. Furtherthisdatamanagesin3differenttables,forexampleSubaccountinformationofCustomer. WetookanexampleofaBankCustomer.WhogetshisprimaryaccountasBankaccountbutthisis possiblethatsamecustomerhasmorethan3typesofaccountslikeCreditAccount,Saving Account&Checkingaccount. WetreattheseaccountsasSubAccount1,SubAccount2&SubAccount3forCreditAccount(Oracle), SavingAccount(SQLServer)&Checkingaccount(DB2)respectively.
TwoPhaseCommitPowerofIBMFederationServer
ApplicationtreatsanewrecordasInsertandanychanged/modifiedrecordasUpdate.Sofor eachstatusitperformsanoperationoneachtargetinstancetomaintainthedataconsistency throughoutthesystem. Lookingbacktotheabovementionedtablediagram,CustomerNameAndrew,andhisCityhas beenchangedtoSanJosetoSantaClara.Pleaseseenumber1tofollowsteps. SothisisanupdateforCustomerAndrew,anditshouldbereflectedinhisallsubaccounts,which resideondifferentdatabases. Forallsuchinsert&update,onceitgetsdone.ApplicationsubmitCommitrequesttoFederation Layer.FederationserverlayeracceptthisrequestasTwoPhaseCommitasitrequiresmorethan onedatabaseinstancefortheinsertion/update. Onceitinserts/updatesconsistentlyoneachdatabase,itsendsanacknowledgmenttoapplication asonlyoneCommitresponseirrespectivetothe3differentcommitresponses.Elseonfailureit getsfailureresponsefromtheFederationserver.
TwoPhaseCommitPowerofIBMFederationServer
References
IBMDB2PL/SQLprogramming