distributed transactions in practice

Upload: talhakamran2006

Post on 31-May-2018

234 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 Distributed Transactions in Practice

    1/7

    D i s t r i b u t ed T r a n s a c t i o n s i n P r a c t ic eP r a b h u R a m , L y m a n D o , a n d P a m e l a D r e w

    B o e i n g P h a n t o m W o r k s , M a t h e m a t ic s a n d C o m p u t i n g T e c h n o l o g y,T h e B o e i n g C o m p a n y ,

    P . O . Box 3307 , M /S 7L -40 ,Sea t t le , WA 98124-2207 .

    {p rabhu . ram, lym an . s . do , pame la . a . d rew} @ boe ing . com

    A b s t r a c tT he concep t o f t r ans ac t ions and i t s app l i ca t ion ha s

    found wide and o f t en ind i s c r imina te u s age . In l a rgeen te rp ri s e s, t he m ode l fo r d i s t r ibu ted da tabas e app l i ca t ionshas moved away f rom the c l i en t -s e rve r mode l to a m u l t i - ti e rmode l w i th la rge da tabas e app l i ca t ion s o f twa re fo rming themidd le ti e r. T he s o f twa re ph i lo s ophy o f " buy and no tbu i ld" in l a rge en te rp r i s e s ha s had a ma jo r in f luence byex tend ing func t iona l r equ i remen t s s uch a s t r ans ac tions andda ta cons i s t ency th rougho u t the m ul t ip l e ti er s. In th i sar t ic le , we wil l d iscuss the effec ts of applying t radi t ionalt rans ac t ion managemen t t e chn iques to mu l t i - t i e ra rch i tec tu re s in d i s t r ibu ted en v i ronmen t s . W e wi l l s how thepe r fo rmance cos t s a s s oc ia t ed w i th d i s t r ibu ted t rans ac t ionsand d i s cus s ways by wh ich en te rp r i s e s rea l ly manage the i rd i s t r ibu ted da ta to c i rcumven t th i s pe r fo rmance h i t . Ourintent is to share our experience as an indus tr ia l cus tomerwi th the da tabas e re s ea rch and v endor com mu ni ty to c rea temore us ab le and s ca lab le de s igns .1 I n t r o d u c t i o n

    In today ' s compe t i t ive bus ine s s wor ld , en te rp r i s e sp re fe r to focus on the i r co re bus ine s s . T hey s pend min im umeffo r t on IT deve lopmen t p ro jec t s and bu i ld the i r bus ine s ss ys tems by in t eg ra t ing commerc ia l o f f t he s he l f (COT S)s o f twa re [COR98 , M IC98] . T he en te rp r i s e s ' managemen thave deemed th i s app roach to be the mos t cos t e f fec t iveway o f deve lop ing the i r i n fo rma t ion managemen t s ys t ems .E ach COT S s o f twa re mee t s a func t iona l need o f thebus ine s s s ys t em. Se lec ted COT S s o f twa re p roduc t s a rein teg rated us ing d i s t ribu ted com mun ica t ion t e chno logy s ucha s C O R B A , D C E , a n d D C O M [ O M G 9 8 , O S F 9 8 , M I C 9 8 ] .E xample s o f s uch COT S s o f twa re inc lude en te rp r i s ere s ource p lanne rs , p roduc t da ta manage rs , en te rp r i s ep roces s mode le r s , f inanc ia l manage men t s o f twa re , e t c .

    M any COT S s o f twa re p roduc t s a re ve r t i c a l da tabas eappl ica t ions tha t s tore the ir bus iness and in ternal da ta in ada tabas e s ys t em. I f t he en te rp r i s e i s geograph ica l lydis t r ibuted, as mos t la rge enterprises are , the COTSs of twa re p roduc t s and the i r un de r ly ing da tabas e s a re o f t end i s t r ibu ted too fo r loca l i ty , au tonomy, and pe r fo rmancerea sons . M o s t o f the s e COT S s o f twa re p roduc t s u s e theDBM S as a da ta a rch ive tha t p rov ides acces s to the i rcontents (bus iness da ta) . Appl ica t ion and bus iness logic areembed ded in the C OT S s o f twa re .

    F igu re 1 : T wo T ie r Arch i t ec tu reIn the c lass ica l c l ient /server mo del (Figu re 1) of sys tem

    dep lo ym en t mos t o f the log ic pe r t a in ing to the app l i ca t ion i sembedded in the s e rve r . " T h in" c l i en t s r eques t s e rv ice s o fthe servers and the servers execute the appl ica t ion logic onthe c l ien t ' s behal f . T he func t ion o f the t r ans ac t ion m anage rwas to coord ina te t r ans ac t ions be tween da tabas e s . T heprol i fera t ion of generic , pre-bui l t ver t ica l appl ica t ions - theCOT S s o f twa re p roduc t s - ha s in t roduced add i t iona l t i e r sbetween the c l ient and the appl ica t ion servers . These mult i -t i e red a rch i t ec tu re s (F igu re 2 ) have had two ma jo r impac t son dis t r ibuted t ransact ions . Firs t , the globa l t ransac t ionman age r i s no longe r d i rec t ly in te rac t ing w i th the da tabas e sbu t the coord ina t ion i s t h rough the COT S s o f twa reprodu cts . As we wil l describe in Sect ion 2 , the CO TSs of twa re ha s to p rov ide add i t iona l func t iona l i t i e s tofac i l i ta te such coordinat ion. Second, the mult i - t ie ra rch i t ec tu re s need a he te rogeneous com mi t p ro toco l wh ich ,a s s hown in Sec t ion 3 , impos es a s ign i f i c an t pe r fo rmancepen al ty on dis t r ibuted t ransact ions .

    Applications

    / \ [Figure 2: Mult i -T ier Archi tec ture

    S I G M O D R e c o r d , V o l . 2 8 , N o . 3 , S e p t e m b e r 1 9 99 4 9

  • 8/14/2019 Distributed Transactions in Practice

    2/7

    2 E f f e c t o f C O T S S o f t w a r eIn th i s s e c t io n , w e in t ro d u c e th e e f f e c t s C O T S s o f tw a re

    h a s o n d i s t r ib u te d s y s t e m s . T h e im p l i c a t io n s o n t r a n s a c t io nm a n a g e m e n t a n d h o w e n t e r p r is e s m a n a g e t he c o n s i s t e n c y o fth e i r d a t a a re a l s o d i s c u s s e d .2 .1 CO T S Sof tw ar e based Env i r onments

    U s e r s i n t e r a c t w i t h C O T S s o f t w a r e b y m e a n s o f" b u s in e s s t r a n s a c t io n s " , w h ic h a re a to m ic u n i t s o f w o rkf r o m t h e u s e r s ' p e r s p e c t iv e . A b u s i ne s s t ra n s a c t io n m a yc o n s t i t u t e m u l t ip l e in t e ra c t io n s b e tw e e n th e a p p l i c a t io n s a n dth e u s e r s . T h e s e in t era c t io n s m a y a l so c a u s e th e C O T Ssoftware t o i n i t i a t e m u l t ip l e d a t a b a s e t r a n s a c t io n s to th eu n d e r l y i n g d a t a b a s es . I f o n l y o n e C O T S s o f t w a r e i si n v o l v e d , i t m a y b e p o s s i b l e t o u s e t h e D B M S ' n a t i v ed i s t r ib u te d t r a n s a c t io n m a n a g e m e n t f a c i l i t y i f t h e u n d e r ly in gd a ta b a s e s a re h o m o g e n e o u s , o r t o u s e a t r a n s a c t io np r o c e s s i n g m o n i t o r t o p r o v i d e t r a n s a c t i o n m a n a g e m e n ts u p p o r t . H o w e v e r , a t y p ic a l i n t e g ra t e d b u s in e s s s y s t e mc o n s i st s o f m o r e t h a n o n e C O T S s o f tw a r e a n d u s u a l l y t h e s eC O T S s o f t w a r e p r o d u c t s a n d t h e i r e m b e d d e d(h e te ro g e n e o u s a n d a u to n o m o u s ) d a t a b a s e s a re in t e g ra t e d ina m u l t i - t i e r e d a rc h i t e c tu re . In a d d i t io n , m o s t C O T S s o f tw a rep r o d u c t s a r e d e v e l o p e d b y i n d e p e n d e n t s o f t w a r e v e n d o r sa n d th e in t e g ra t io n w i th o th e r p ro d u c t s o c c u r s a lm o s ta lw a y s m u c h l a t e r i n i t s li f e c y c le a n d in s o m e c a s e s , i n a n a dh o e m a n n e r . E v e n w h e n p ro d u c t s i n t e ro p e ra t e , i t i s m o s tl ik e ly th e y o n ly in t e ra c t a t t h e in t e r f a c e l e v e l a n d n o t a t t h es e m a n t i c l e v e l . F o r e x a m p le , t h e d e f in i t i o n o f a n a to m icu n i t o f w o r k i n o n e p r o d u c t m a y n o t m a t c h t h a t o f a n o t h e r .T h e h e t e r o g e n e i t y a n d a u t o n o m y o f t h e e n c a p s u l a t e dd a t a b a s e s c o u p l e d w i t h t h e C O T S s o f t w a r e n o t b e i n gd e s ig n e d fo r l a rg e s c a l e in t e g ra t io n m a k e th e t a s k o fp r o v i d i n g t r a n s a c t i o n m a n a g e m e n t m u c h m o r e d i f f i c u l t i na n in t e g ra t e d s y s t e m . In o rd e r t o p ro v id e t r a n s a c t io nm a n a g e m e n t i n t h i s e n v i r o n m e n t , e a c h C O T S s o f t w a r e h a sto fu n c t io n a s a r e s o u rc e m a n a g e r . I t s e rv e s a s a w ra p p e r toi t s e n c a p s u la t e d d a ta b a s e ( a s s h o w n in F ig u re 2 ) a n d b r id g e st h e c o m m u n i c a t i o n b e t w e e n a g l o b a l t ra n s a c ti o n c o o r d i n a t o ra n d i t s e n c a p s u la t e d d a ta b a s e ( s ) .2 .2 Con s is tency Management App r oaches

    T h e r e a re th re e p o s s ib l e s c e n a r io s a s t o h o w t r a n s a c t io nm a n a g e m e n t c a n b e im p l e m e n t e d w i t h C O T S s o f t w a r e - a)th e C O T S s o f tw a re c a n u s e th e n a t iv e t r a n s a c t io nm a n a g e m e n t f a ci l i ty o f i ts e m b e d d e d D B M S s ( w i t h s o m el im i t a t io n s th a t w e w i l l d i s c u s s) , b ) t h e C O T S s o f tw a rein t e ra c t s w i th a n e x te rn a l t r a n s a c t io n m a n a g e m e n t s y s t e m toc o o rd in a te d i s t r ib u te d t r a n s a c t io n s , a n d c ) t h e s o f tw a rep ro v id e s n o t r a n s a c t io n m a n a g e m e n t at a ll a n d l e t s t h e e n du s e r a s s u m e th e r e s p o n s ib i l i t y fo r m a in ta in in g d a tac o n s i s t e n c y v i a b u s in e s s p ro c e s s e s . In T h e B o e in gC o m p a n y , w e h a v e p r o d u c t i o n s y s t e m s w h i c h a r e e x a m p l e so f e a c h o f t h e a b o v e s c e n a r io s .

    In th e f i r s t c a s e , t h e re c a n b e m u l t ip l e h o m o g e n e o u sD B M S s c o n t r o l l e d b y t h e s a m e C O T S s o f t w a r e ( d u e t od i s t r ib u t io n ) a n d th e C O T S s o f tw a re c a n c h o o s e to u s e th ed i s t r ib u te d t r a n s a c t io n m a n a g e m e n t f a c i l i t y o f th e D B M Sp ro d u c t b y b ra c k e t in g th e b u s in e s s t r a n s a c t io n w i tht r a n s a c t io n begin a n d commit. T h e a s s u m p t i o n c l e a r l yi s t h a t t h e d a ta b a s e s a re n o w a w a re o f e a c h o th e r a n df u n c t io n a s o n e d i s t r i b ut e d d a t a b a s e . T h i s a p p r o a c h m a y n o ta l l o w m u l t i p l e C O T S s o f t w a r e p r o d u c t s t o i n t e r a c t , d u e t ot h e p o t e n ti a l h e t e r o g e n ei t y o f t h e e m b e d d e d d a t a b a s e s a n dt h e e n ca p s u la t i o n o f t h e d a t a b a s e s b y t h e C O T S s o f t w a r ep ro d u c t s . H e n c e , u s in g th e n a t iv e t r a n s a c t io n m a n a g e m e n tfu n c t io n h a s l im i t e d a p p l i c a b i l i t y in in t e g ra t e d m u l t i -C O T Ss o f tw a re b u s in e s s s y s t e m s .

    I f t ra n s a ct i o n m a n a g e m e n t i s r eq u i r e d a n d t h e C O T Ss o f t w a r e e n c a p s u l a t e s t h e d a t a b a s e , m o s t e m p l o ym i d d l e w a r e t e c h n o l o g y f o r t h e p u r p o s e . A s a r e s u l t o fe n c a p s u la t io n , t h e D B MS s p a r t i c ip a t in g in d i s t r ib u te dt r a n s a c t io n s m u s t n o w c o o rd in a te th e i r a c t io n s th ro u g h th eC O T S s o f t w a re p r o d u c t s . T r a n s a c t i o n m a n a g e m e n tc o m p o n e n t s c a n e i t h e r b e e m b e d d e d w i t h i n t h e C O T Ss o f tw a re o r c a n b e p ro v id e d b y a n e x te rn a l s o f tw a re a s as e rv ic e . Mid d le w a re , s u c h a s t r a n s a c t io n p ro c e s s in gm o n i t o r s [ B E A 9 6 , T R A 9 7 ] , o b j e c t t r a n s a c t i o n m o n i t o r s[ I O N 9 7 , R D P Z 9 9 ] , a n d t r a n s a c t i o n s e r v e r s [ M T S 9 8 ] ,p r o v i d e t h e t w o p h a s e c o m m i t m e c h a n i s m b y a l l o w i n gd i s t r ib u te d t r a n s a c t io n s to b e b ra c k e te d u s in g p ro p r i e t a ryt r a n s a c t io n begin a n d commit.

    R e g a r d l e s s o f w h e t h e r t h e t r a n s a c t i o n m a n a g e r i se m b e d d e d o r i s e x t e r n a l t o t h e C O T S s o f t w a r e , n u m e r o u sm o d i f i c a t i o n s m u s t b e m a d e t o t h e C O T S s o f t w a r e t os u p p o r t t he tr a n s ac t i o n m a n a g e r . I f a C O T S s o f t w a r ee n c a p s u la t e s t h e u n d e r ly in g d a ta b a s e a n d i s e x p e c te d toin t e ra c t t r a n s a c t io n a l ly w i th o th e r s o f tw a re , i t m u s t b e a b leto b e h a v e a s a r e s o u rc e m a n a g e r to in t e ra c t w i th a g lo b a lt r a n s a c t io n c o o rd in a to r a n d to r e -d i r e c t t h e g lo b a lc o o rd in a t io n to i t s e n c a p s u la t e d d a ta b a s e s . T h i s i n v o lv e sm a p p i n g a g l o b a l t r a n s a c t i o n t o o n e o r m o r e l o c a lt r a n s a c t io n s a n d e x p o r t in g t r a n s a c t io n s t a t e s s u c h a sP R E P A R E D t o a l l o w c o o r d i n a t i o n w i t h e x t e r n a l l yo r ig in a t in g t r a n s a c t io n s. I t m u s t b e n o te d th a t th e c o n c e p to f h e t e r o g e n e o u s t w o p h a s e c o m m i t ( 2 P C ) a n d s u p p o r t f o ri t t h r o u g h o p e r a t i o n s s u c h a s P R E P A R E t o o k n e a r l y ad e c a d e to ge t i m p l e m e n t e d b y D B M S v e n d o r s . B r e i t b a rt[B R E 9 0 ] r e fe re n c e s s e v e ra l e a r ly r e s e a rc h e f fo r t s t h a tm e n t i o n e d t h e n e e d f o r a n o p e r a ti o n s u c h a s P R E P A R E b u ti t w a s n o t u n t i l t h e l a s t fo u r to f iv e y e a r s t h a t m o s t p o p u la rD B M S v e n d o r s s u p p o r t s u c h o p e r a t i o n s . B e c a u s e C O T Ss o f tw a re p ro d u c t s e n c a p s u la t e th e d a ta b a s e s , t r a n s a c t io nc o o rd in a t io n h a p p e n s a t t h e C O T S l e v e l i n s t ea d o f a t t h ed a ta b a s e l e v e l , a n d th e r e q u i re m e n t to s u p p o r t 2 P C h a s b e e np a s s e d o n to C O T S s o f tw a re a s w e l l .

    G iv e n th e t e c h n ic a l c o m p le x i t i e s a s s o c ia t e d w i thin t e g ra t in g e x te rn a l t r a n s a c t io n m a n a g e r s in to th ea rc h i t e c tu re a n d g iv e n th a t t h is r e q u i re s m o d i f i c a t io n o f th e

    5 0 S I G M O D R e c o r d , V o l . 2 8 , N o . 3 , S e p t e m b e r 1 9 9 9

  • 8/14/2019 Distributed Transactions in Practice

    3/7

    C O T S b e h a v io r , s ev e r al C O T S s o f t w a r e p r o d u c ts s i m p l y d on o t p ro v id e g lo b a l t r an sac t i o n man ag emen t an d l eav e i t u pto t h e en d -u se r s t o mi t i g a t e t h e r i sk s t o t h e i r d a t a t h ro u g hth e i r o wn b u s in ess p ro cesses . Th i s i s fa i r l y co m mo n in l a rg esca l e i n t eg ra t i o n p ro j ec t s . Th i s ap p ro ac h i s a i d ed b y t h e f ac tt h a t mo s t t r an sac t i o n man ag emen t so f tware i s an o th erso f tware sy s t em fo r th e en d -u se r t o man ag e an d t h emain t en an ce co s t b eco me s p ro h ib it i v e in a l o n g ru n . Hen ce ,t h e re h as n o t b een en o u g h o f a p u sh b y en d -u se r s t o d eman dt r a n s a c t i o n m a n a g e m e n t c o m p l i a n c e o f C O T S s o f t w a r ep ro d u c t s . O th er f ac to r s wh ich d e t r ac t f ro m t r an sac t i o nman ag emen t u sag e , su ch as p e r fo rman ce d eg rad a t i o n , w i l lb e d i scu ssed i n S ec t io n 3.2 .

    Th e b u s in ess d a ta i s st il l v a lu ab l e t o th e en t e rp r i se . S oe v e n i f t h e C O T S s o f t w a r e p r o du c t s d o n o t p r o v i d et r an sac t i o n man ag emen t , t h e en d -u se r s h av e b u s in ess an dm a n a g e m e n t p r o c e s s e s to m a i nt a in t h e c o n s i s t e n c y o f d a t ain th e i r bu s in ess sy st ems . An ex am p le o f a b u s in ess p ro cessi s t h a t a u se r may n o t b e a l l o wed t o ex ecu t e a p a r t i cu l a rap p l i ca t i o n wh en an o th er ap p l i ca t io n i s ex ecu t i n g . Bu s in essp ro ces ses o f t en d ep en d o n t h e en d -u se r s ' t r a i n in g an dd i sc ip l i n e an d h en ce a r e p ro n e t o e r ro r s . O th e r p ro cessesm a y b e u sed t o d e t ec t an d co r r ec t i n co n s i s t en t d a t a ac ro ssCOTS so f tware . F o r i n s t an ce , en d -u se r s may mo n i to rmessag e t r a f f i c ac ro ss COTS so f tware b y u s in g messag een t ry / ex i t p o in t s i n t h e d i s tr i b u ted co mm u n ica t i o n l ay er an dcap tu re t h e messag e t r a f f i c a s i t f l o ws t h ro u g h t h e sy s t em.Th e cap tu red messag es may b e wr i t t en t o a d a t ab ase an d b ean a ly zed l a t e r fo r e r ro rs . F o r ex amp le , i f COR BA i s t h ein t eg ra t i o n t ech n o lo g y u sed , th e messag es a r e cap tu re d eacht i m e a n i nt e r- O R B c o m m u n i c a ti o n (O R B o f o n e C O T Sso f tware t o an o th er ) o ccu r s u s in g mar sh a l i n g ex i t s . Th i ses sen t i a l l y cap tu res fo u r messag e en t ry / ex i t p o in t s ( asshown in F igure 3 ) in a d is t r ibu ted business t ransact ion .Th i s k in d o f r eac t iv e ap p ro ach can d e t ec t f a i l ed t r an sac t i o n sb u t can n ev er d e t ec t an i n co r r ec t i n t e r l eav in g b e tween twosu b - t r an sac t i o n s . As a r esu l t , d a t a e r ro r s can p o t en t i a l l yp ro l i f e r a t e t o o th e r ap p li ca t io n s d u e t o t h e t im e l ag b e tweenth e f a i l ed t r an sac t i o n an d t h e man u a l co r r ec t i o n e f fo r t .

    F ig u re 3 : Au d i t in g o f Di s t r i b u t ed M es sag eTh e r i sk o f n o t d e t ec t in g a l l th e f au l t s i s a s su med b y t h e

    en d -u se r o rg an iza t i o n b u t t h i s co u ld b e mi t i g a t ed b y t h eCOTS so f tware ch arac t e r i s t i c s an d ap p l i ca t i o n seman t i cs .F o r ex a mp le , i f t he COT S so f tware v e r s i o n s i ts d a t a , t h ep o t en t i a l f o r co n f l i c t d o es n o t ex i s t an y m o re an d o n ly f a i l edn o n -a to mic b u s in ess t r an sac t i o n s n eed t o b e d e t ec t ed .Giv en t h e t ech n i ca l , man ag emen t , an d p er fo rman ce

    co mp lex i t i e s a s so c i a t ed wi th i n co rp o ra t i n g d i s t r i b u t edt r an sac t i o n man ag emen t i n to COTS so f tware p ro d u c t s ( assh o wn in S ec t i o n 3 .2 ) , en d u se r s f ee l j u s t i f i ed b y fo l l o win gp ro cesses su ch as t h ese t o imp ro v e t h e q u a l i t y o f t h e i r d a t awi th o u t u s in g t r an sac t io n ma n ag em en t .

    Giv en t h e t h r ee ap p ro ach es t o main t a in in g d a t aco n s i s t en cy , b y n a t i v e DBM S t r an sac t i o n man ag emen tfu n c t i o n s , b y mid d l eware t r an sac t i o n man ag er s , an d b yl ev erag in g b u s in ess p ro cesses wi th o u t an y g lo b a lt r an sac t i o n co o rd in a t i o n , an en t e rp r i se may ch o o se an y o ft h e ab o v e ap p ro ach es (b ased o n wh a t t h e i r COTS v en d o r ssu p p ly ) t o main t a in t h e co n s i s t en cy o f i ts b u s in ess d a t a an db u t t r es s i t w i th t h e i r o wn b u s in ess an d d a t a man ag emen tp ro cesses . Ho we v er , man y en t e rp r i ses l ean t o ward s t he l a stap p ro ach o f n o t u s in g t r an sac t i o n man ag em en t a t a ll an d u seth e i r o wn b u s in ess an d man ag emen t p ro cesses t o k eep t h e i rd a t a co n s i s ten t . On e d o m in an t r easo n fo r t h i s i s t h ep er fo rman ce o v erh ead as so c i a t ed wi th t r an sac t i o nman ag e men t i n d i s t r i b u t ed i n t eg ra t ed sy s tems .3 The Per formance Impact

    Bes id es d e l i v e r i n g o n fu n c t i o n a l i t y , p e r fo rman ce i nl a rg e d i s t r ib u t ed sy s t em i s o f t en t h e g au g e o f h o w su ccess fu lan imp lemen ta t i o n i s . T ran sac t i o n s co me wi th ap er fo rman ce co s t fo r r easo n s i n c lu d in g ro l l b ack seg men t smain t en an ce , ad d i t i o n a l l o g g in g , e t c . Wh en t r an sac ti o n s a r ed i s t r i b u t ed an d h e t e ro g en eo u s , o th e r f ac to r s su ch asd a t a b a s e c o n n e c t i o n s m a n a g e m e n t a n d c o m m i t p r o t o c o l sa l so co n t r ib u t e t o t h e o v erh e ad .

    Wh en d i s t r i b u t ed d a t ab ases a r e i n v o lv ed , p r esu medab o r t 2 P C i s b y f a r t h e d o min an t mech an i sm u sed i nco mmerc i a l p ro d u c t s t o ach i ev e a to mic i t y i n d i s t r i b u t edt r an sac t i o ns . Co u p led wi th s t r ic t n ess [BHG 8 7 ] , t h eyprovide ser ial izab i l i ty to g lobal d is t r ibu ted t ransact ions .2 P C i s v e ry o f t en t h e o n ly mech an i sm av a i l ab le t o main t a ind a t a co n s i s t en cy in man y d i s t r ib u t ed sy s t ems . Ad d i t i o n a l l y ,mo s t o f th e 2 P C imp lem en ta t i o n s a r e co u p l ed wi ths y n c h r o n o u s c o m m u n i c a t i o n m e c h a n i s m s ( s u c h a s R P C )cau s in g each s t ep o f t h e t r an sac t i o n t o b e b lo ck ed u n t il t h es t ep p reced in g i t h as co mp le t ed r esu l t i n g i n fu r t h e rd eg rad a t i o n o f r esp o n se t ime .

    On e a l t e rn a t i v e t o sy n ch ro n o u s 2 P C fo r imp ro v in gt r an sac ti o n r esp o n se t ime i s a sy n ch ro n o u s mech an i sms su chas p e r s i s ten t q u eu es . I t a ll o ws a c l i en t t o d e tach f ro m ase rv er p r i o r t o t h e co mp le t i o n o f t h e se rv er ex ecu t i o n ,resu l t ing in bet te r resp onse t im e for the cl ien t . I f theasy n ch ro n o u s mech an i sm a l so g u aran t ees t r an sac t i o n a lseman t i cs (o n ce an d o n ly o n ce ex ecu t i o n ) i t can b e v e rya t t r ac t i v e t o ap p l i ca t i o n s t h a t d o n o t r eq u i r e sy n ch ro n o u s(an d b lo ck in g ) b eh av io r .

    In t e r es t i n g ly , a sy n ch ro n o u s mech an i sms (wh ich a r eimp lemen ted as r eso u rce man ag er s ) a l so u se t h e 2 P Cp ro to co l i n t h e i r ex ecu t i o n . Th ey es sen t i a l l y b reak ad is t r ibu ted t ransact ion in to th ree par ts - one to del iver thed a t a t o th e asy n c h ro n o u s m ech an i sm, t h e seco n d t o r e li ab ly

    S I G M O D R e c o r d , V o l . 2 8 , N o . 3 , S e p t e m b e r 1 9 99 5 1

  • 8/14/2019 Distributed Transactions in Practice

    4/7

    d e l i v e r t h e d a ta t o a r e m o t e c o m p u t e r ( b y t h e a s y n c h r o n o u sm e c h a n i s m s ) , a n d th e th i rd to r e m o v e th e d a ta f ro m th ea s y n c h ro n o u s m e c h a n i s m s . I f d a t a b a s e s a r e i n v o l v e d i ns t e p s o n e a n d th re e , a h e t e ro g e n e o u s 2 P C p ro to c o l i se x e c u t e d b e t w e e n t h e a s y n c h r o n o u s m e c h a n i s m a n d t h ed a ta b a s e s to g iv e a to m ic i ty to th o s e in d iv id u a l t r a n s a c t io n s .S i n c e t h e a s y n c h r o n o u s m e c h a n i s m g u a r a n t e e s o n c e a n do n ly o n c e e x e c u t io n o f i ts m e s s a g e s , t h e th re e s t e p s to g e th e rb e h a v e a s o n e a to m ic g lo b a l t r a n s a c t io n . B e s id e s g iv in g ab e t t e r r e s p o n s e t im e fo r c l i e n t s , b y s p l i t t i n g a n a to m icg lo b a l t r a n s a c t io n in to th re e a to m ic t r a n s a c t io n s ,a s y n c h ro n o u s t r a n s a c t io n a l m e c h a n i s m s h a v e th e p o te n t i a lto im p ro v e t r a n s a c t io n th ro u g h p u t .

    A n a d d i t i on a l c o m p o n e n t o f h e t e r o g e n e o u s , d i s t r ib u t e dt r a n s a c t io n s i s t h e u s e o f t h e X A in t e r f a c e [X A 9 1 ] . I f u s in gh e t e r o g e n eo u s o r e n c a p s u l a t e d d a t a b a s e s , t h e X A i n t e rf a c ei s t h e o n l y a v a i l a b l e c o m m e r c i a l w a y o f c o o r d i n a t i n gc o m m i t s o f d i s t ri b u t e d t r a n s a ct i o n s. X A i s a n X / O p e ns t a n d a r d t h a t i s i m p l e m e n t e d b y t h e r e s o u r c e m a n a g e rv e n d o r s a n d a l l o w s t h e r e s o u r c e m a n a g e r t o e x p o s et r a n s a c t i o n s t a t e s f o r g l o b a l c o m m i t m e n t p u r p o s e s . B o t hs y n c h r o n o u s a n d a s y n c h r o n o u s p r o t o c o l s u s e t h e X Ain te r fa c e to c o o rd in a te a t r a n s a c t io n b e tw e e n d a ta b a s es y s t e m s an d o t h e r r e s o u rc e m a n a g e r s . T h e u s e o f t h e X Ai n t e rf a c e a ls o c o m e s w i t h a p e r f o r m a n c e c o s t w h i c h w e w i l ld iscuss in Sec t ion 3 .2 .

    S in c e d i s t r ib u te d t r a n s a c t io n s in t ro d u c e o v e rh e a d , w ep e r f o r m e d s e v e r a l e x p e r i m e n t s t o q u a n t i f y t h e c o s t sa s s o c ia t e d w i th th e m . F o r v a r io u s w o rk lo a d s w e w i l l s h o wt h e c o s t a s s o c ia t e d w i t h p e r f o r m i n g a g l o b a l c o m m i t a n d t h ec o s t o f u s in g t h e X A i n t e r fa c e t o f a c i l i ta t e c o m m i tc o o r d in a t io n . W e w i l l a l s o c o m p a r e r e s p o n s e t i m e an dt h r o u g h p u t o f 2 P C c o o r d i n a t e d t r a n s a c ti o n s a g a i n s t a na s y n c h r o n o u s t r a n s a c t i o n m e c h a n i s m i m p l e m e n t e d u s i n gt ra n s a c t io n a l q u e u e s fo r v a r io u s w o rk lo a d s a n d s y s t e mc o n f ig u ra t io n s .3 .1 Ex pe r i me nta l Se tup

    O u r e x p e r im e n t s a re d e s ig n e d to i s o l a t e t h e c o s t sa s s o c ia t e d w i th c o m m i t c o o rd in a t io n a n d r e l a t e dc o m p o n e n t s o f d i s tr i b u te d h e t e r o g e n e o u s t r a n sa c t io n s . T om o n i t o r t h e b e h a v i o r o f t h e t r a n s a c t i o n m a n a g e m e n tc o m p o n e n t s , t h e D B M S w a s r e q u i re d t o p e r f o r m u n i f o r m l ya t a l l t im e s . W e a c h ie v e d th i s b y m a k in g a l l o u r d a t a b a s eoperations I n s e r t s - w h ic h c a u s e s a t ru e w r i t e t o th e d i s ks y s t e m (a s a g a i n st a n u p d a te f o r w h i c h t h e D B M S m a y g ot o a c a c h e a n d t h e c o m m e r c i a l D B M S w e u s e d i n o u re x p e r i m e n t s a l l o w s d i rt y r e ad s ) . O u r w o r k l o a d s v a r i e d f r o ms in g le r e c o rd in s e r t t o 1 4 0 0 re c o rd in s e r t s p e r t r a n s a c t io nc h a r a c t e r i z i n g a s p e c t r u m t h a t c a n m a p o n t o O L T P t oD e c i s i o n S u p p o r t S y s t e m s t y p e o f w o r k l o a d s . T h ee x p e r im e n t s w e re a l s o ru n in i s o l a t io n w i th o u t a n y n o n -e s s e n t i a l a p p l i c a t io n s ru n n in g . R e c o rd s in o u r d a t a b a s e sw e re 1 0 0 b y te s lo n g e a c h .

    O u r e x p e r i m e n t s w e r e p e r f o r m e d o n t h r e e 3 0 0 M H zN T s e r v e r s w i t h 1 2 8 M R A M e a c h . T w o c o p i e s o f ac o m m e r c i a l D B M S p r o d u c t w e r e h o s te d o n t w o se r v e r s a n df u n c t i on e d a s a u t o n o m o u s D B M S s u n a w a r e o f t h e o t h e r ' se x i s t e n c e . T h e D B MS s w e re tu n e d id e n t i c a l ly a n d th ed a ta b a s e a n d lo g s i ze w e re s e t l a rg e e n o u g h to h a n d le o u rw o rk lo a d s w i th o u t c a u s in g e x te n t a l lo c a t io n d u r in g th ee x e c u t io n o f o u r t e s t s . A l l t h e r e s u l t s r e p o r t e d a re f ro mw a r m r u n s - t h e a p p l i c a t i o n s w e r e r u n f o r a f e w m i n u t e s ,fo l lo w e d b y a n in t e rv a l i n w h ic h r e s u l t s w e re r e c o rd e d ,f o l l o w e d b y t h e a p p l i c a t i o n r u n n i n g f o r f e w m o r e m i n u t e s .W e c o n t r o l l e d t h e e x p e r i m e n t s u s i n g a c o m m e r c i a lt r a n s ac t i o n p r o c e s s i n g m o n i t o r t h at p r o v i d e d ah e t e r o g e n e o u s 2 P C m e c h a n i s m a n d a t r a n s a c t i o n a l q u e u ew h i c h w e u s e d a s t h e a s y n c h r o n o u s m e c h a n i s m . T h e q u e u e(w h ic h i s a l s o a r e s o u rc e m a n a g e r ) w a s h o s t e d in th e th i rdm a c h i n e , s o th a t t he q u e u e a n d t h e D B M S s d o n o t c o m p e t eo n I / O .

    4 5 0 0 ,4 0 0 0 ,p ~u,

    _ ~ 2 s o o~ 2 o o oco~soo

    I~ 100050 0

    l a 2 P C T o ~I Io u n c o o ~ . T o ~ J" H

    1 10 50 100 150 2 00 400 600 800W o r k l o a d p e r T r a n s ac t i o n

    " - ' I' |

    1 0 0 0 1 2 0 0 1 4 0 0

    F i g u r e 4 : 2 P C v s . U n c o o r d i n a t e d T r a n s a c t i o n s

    3 . 2 R e s u l ts a n d D i s c us s i onsF ig u re 4 s h o w s the o v e ra l l r e s p o n s e t im e s o f 2 P C

    c o o rd in a te d s y n c h ro n o u s t r a n s a c t io n s a g a in s t t h e e q u iv a le n tu n c o o rd in a te d d i s t r ib u te d " t r a n s a c t io n s " . T h e 2 P Cc o o r d i n a t e d t r a n s a c t i o n s w e r e i m p l e m e n t e d t h r o u g h t h e X Ain te r fa c e to o b ta in c o n n e c t io n s a n d h a n d le s to th e D B MS sa n d u s ed t h e 2 P C m e c h a n i s m p r o v i d e d b y th e T P m o n i t o r t oc o o rd in a te g lo b a l t r a n s a c t io n s . T h e u n c o o rd in a te do p e r a t i o n s w e r e i m p l e m e n t e d b y h a v i n g t h e c l i e n t c a l lr e m o t e s e r v e r s t h a t w e r e i m p l e m e n t e d u s i n g t h e D B M S 'n a t iv e A P Is a n d w i th o u t b l a n k e t in g w i th th e g lo b a lt r a n s a c t io n begin a n d commit. T h e r i s k h e re i s t h a tg lo b a l a to m ic i ty i s n o t g u a ra n te e d a n d th e in t e n t o f t h ise x p e r im e n t i s to h ig h l ig h t t h e c o s t a s s o c ia t e d w i th ru n n in g ac o o rd in a te d t r a n s a c t io n . T h e X -a x i s r e p re s e n t s a w id er a n g e o f w o r k l o a d s . T h e r e s p o n s e t i m e i s r e p o r t e d i nm i l l i s e c o n d s o n th e Y -a x i s . F ro m th e f ig u re , i t c a n b e s e e nth a t 2 P C c o o rd in a t io n a d d s a t l e a s t 2 5 % m o re to th ere s p o n s e t im e a c ro s s th e b re a d th o f t h e w o rk lo a d s . W e w i l la n a l y z e t h e c o m p o n e n t s t h a t c a u s e t h i s p e r f o r m a n c eo v e rh e a d in F ig u re 5 .

    5 2 S I G M O D R e c o r d , V o l . 2 8 , N o . 3 , S e p t e m b e r 1 9 9 9

  • 8/14/2019 Distributed Transactions in Practice

    5/7

    F ig u re 5 s h o w s th e t im e t a k e n b y th e in d iv id u a lc o m p o n e n t s o f t h e 2 P C c o o r d i n a te d t r a ns a c ti o n s s h o w n i nF ig u re 4 . T h e c o m p o n e n t s o f a d i s t r ib u te d t r a n s a c t io n a reth e t im e t a k e n b y th e s e rv ic e s to m o d i fy th e d a ta b a s e s a n dth e to t a l t im e to c o o rd in a te th e tw o s u b - t r a n s a c t io n s . T h e

    _ zgo~:~oOE:i ~sooI=~ 1000

    13XA Tkr ~II ~tc ~rr~ B

    I I r r. . . . .- . d A Id J d . .1 10 50 100 150 200 400 600 800 10 00 1200 1400Workload per Transaction

    Figure 5: Distributed Transaction Componentsc o o r d i n a t i o n c o m p o n e n t c a n b e f u r t h e r b r o k e n d o w n i n t oth e t im e t a k e n a s s o c ia t e d w i th X A a n d th e t im e t a k e n toe x e c u t e t h e 2 P C a l g o r i t h m . T h e 2 P C e x e c u t i o n t i m e w a so b ta in e d b y in s t ru m e n t in g b e fo re a n d a f t e r t h e com m it ca l lo f t h e d i s tr ib u te d t r a n s a c t io n a n d in c lu d e s th e lo c a l c o m m i tc o s t s a t th e t w o D B M S s .

    Wh i l e i t i s im p o s s ib l e to i s o l a t e t h e X A a n d 2 P Cc o m p o n e n t s , w e u s e d th e fo l lo w in g m e th o d to g e t t o a v e ryc l o s e a p p r o x i m a t i o n . T h e t i m e t a k e n b y a c o o r d i n a t e dt r a n s a c t io n in c lu d e s th e to t a l s e rv ic e tim e , tw o lo c a l c o m m i tt im e s , t h e e x t r a t im e t a k e n d u e to th e u s a g e o f t h e X Ain te r fa c e s b y th e s e rv ic e s , a n d th e 2 P C a lg o r i th m e x e c u t io nt im e . A d d i t io n a l ly , w e in s t ru m e n te d th e s e rv ic e s to g e t t h et im e a s s o c ia t e d w i th s u b - t r a n s a c t io n s ' s e rv i c e t im e s a t e a c hD B M S w h e n t h e u n c o o r d i n a t e d " t r a n s ac t i on s " o f F i g u r e 4w e r e e x e c u t e d . W e o b t a i n e d t h e X A t i m e b y u s i n g t h ef o l l o w i n g f o r m u l a : T o t a l t i m e o f 2 P C c o o r d i n a t e dt r a n s a c t io n - T o ta l s e rv ic e t im e - 2 P C t im e .F ro m F ig u re 5 , a s o n e w o u ld e x p e c t t h e t im e a s s o c ia t e dw i th th e 2 P C a lg o r i th m e x e c u t io n i s a c o n s t a n t r e g a rd le s s o fth e w o rk lo a d . T h e X A t im e s o n th e o th e r h a n d r a n g e a l l t h ew a y f r o m 1 0 % o f t h e t o t a l tr a n s ac t i on t i m e f o r v e r y s m a l lw o r k l o a d s t o o v e r 3 0 % o f t h e t o ta l t r an s a c ti o n t i m e f o rl a rg e r w o rk lo a d s . F o r a 1 0 in s e r t t r a n s a c t io n , t h e s e rv ic et i m e s t o ta l u p t o a p p r o x i m a t e l y 2 1 % , t h e X A t i m ea p p r o x i m a t e l y 1 4 % , a n d , t h e 2 P C t i m e a p p r o x i m a t e l y 6 5 %o f th e to t a l r e s p o n s e t im e o f t h e tr a n s a c tio n . F o r a 1 0 0 in s e r tt r a n s a c t io n , t h e p e rc e n ta g e s a re 3 7 %, 3 7 % a n d 2 6 % fo rs e rv ic e t im e s , X A t im e , a n d 2 P C t im e , r e s p e c t iv e ly . T h ep e rc e n ta g e s fo r a 1 0 0 0 in s e r t t r a n s a c t io n a re 6 9 %, 2 7 % a n d4 % , r e s p e c t iv e l y . I t c a n a l so b e o b s e r v e d th a t th e X A c o s t si n c r e as e a s t h e n u m b e r o f S Q L s t a t e m e n ts i n c r e as e ( s h o w nb y t h e m a g n i t u d e o f t h e X A t i m e s in F i g u re 5 f o r l a r g e rw o r k l o a d s ) .

    F i g u r e s 4 a n d 5 c a n ex p l a in w h y m a n y C O T S s o f t w a r ev e n d o rs a re r e lu c t a n t t o in c lu d e t r a n s a c t io n m a n a g e m e n tc o m p o n e n t s i n th e i r p ro d u c t s . W h i l e th e t r a n s a c t io nm a n a g e m e n t c o m p o n e n t s a r e r e q u i r e d f o r m a i n t a i n i n g d a t a

    c o n s i s t e n c y in a m u l t i -C O T S s o f tw a re in t e g ra t e d s y s t e m , i tm a k e s i n d i v id u a l C O T S s o f t w a r e p e r f o r m a n c e l o o k b a d.A d d i t i o n a l l y , t h e C O T S v e n d o r s t r y t o f o l l o w S Q Ls ta n d a rd s (S Q L 9 2 fo r n o w ) w h e n in t e ra c t in g w i th ad a ta b a s e s o th a t t h e i r p ro d u c t c a n fu n c t io n w i th m o s tp o p u l a r c o m m e r c i a l d a t a b a s e s f o r a w i d e r m a r k e t a p p e a l .T h e e f f e c t t h o u g h i s t h a t t h e r e i s n o w m o r e S Q L t r a f f i cb e t w e e n t h e C O T S s o f t w a r e a n d t h e D B M S ( t h r o u g h t h eX A i n t e r f a c e ) a n d t h e p e r f o r m a n c e d e g r a d a t i o n i s f u r t h e ra m p l i f i e d ( a s s h o w n in F ig u re 5 ) . A fu r th e r d e t r im e n ta le f f e c t o f f o ll o w i n g c u r r en t S Q L s t a n d ar d s i s t h a t t h e C O T Ss o f tw a re i s u n a b le to t a k e a d v a n ta g e o f o p t im iza t io n s th a tm a y b e a v a i l a b l e f r o m i n d i v id u a l D B M S p r o d u c t s s u c h a ss p e c ia l i n d ic e s , S Q L h in t s , e tc .

    I f t h e a p p l i c a t io n c a n to l e ra t e a t im e l a g b e tw e e n th e i rs u b - t r a n s a c t io n s a n d c o n f l i c t in g t r a n s a c t io n s a re m in im a l ,a s y n c h ro n o u s t r a n s a c t io n m e c h a n i s m s a re a l e g i t im a tea l t e rn a t iv e to 2 P C c o o rd in a te d t r a n s a c t io n s a c ro s s C O T Ss o f t w a r e [ D R D 9 9 ] . F i g u r e 6 s h o w s t h e p e r c e n t a g ec o m p a r i s o n o f th e r e s p o n s e ti m e s b e t w e e n 2 P C c o o r d i n a t e dt r a n s a c t io n s b e tw e e n th e tw o d a ta b a s e s vs. t h e e n q u e u e t im ein to a p e r s i s t e n t q u e u e b a s e d a s y n c h ro n o u s t r a n s a c t io n s fo rv a r io u s w o rk lo a d s . T h e e n q u e u e t im e i s t h e p e rc e iv e d u s e rre s p o n s e t im e . I t in c lu d e s th e t im e to in s e r t r e c o rd s in to th eD B MS a n d to p u t t h e d a ta in th e q u e u e a s a s in g le 2 P Ct ra n s a c t io n b e tw e e n o n e d a ta b a s e a n d th e q u e u e . T h em e s s a g e s in th e q u e u e in c lu d e a n o v e rh e a d fo r m e s s a g eh e a d e r . F o r s m a l l e r w o rk lo a d s (b o th sin g le in s e r t a n d 1 0in s e r t s f i t o n o n e d i s k p a g e ) , t h e o v e rh e a d a s s o c ia t e d w i thq u e u e m a n a g e m e n t m a k e s 2 P C c o o r d i n a t e d t r a n s a c t i o n s ab e t t e r p e r f o r m a n c e o p t io n . T h e p e r c e n t a g e o v e r h e a d f o r a10 inse r t t ransac t ion is le s s than tha t fo r s ing le inse r tt r a n sa c t io n s , b e c a u s e t h e m e s s a g e h e a d e r o v e r h e a d b e c o m e sa s m a l l e r p e rc e n ta g e o f th e to t al m e s s a g e . F o r a l l l a rg e rlo a d s , t h e r e s p o n s e t im e a s s o c ia t e d w i th th e q u e u e i sa p p r o x i m a t e l y 3 5 - 4 0 % b e t t e r th a n t h e e q u i v a l e n t 2 P Ct ra n s a c t io n s . I t i s o u r o b s e rv a t io n f ro m e x p e r i e n c e th a t d u eto th e n a tu re o f " b u s in e s s t r a n s a c t io n s " a n d d u e to m u l t ip l ein t e ra c t io n s b e tw e e n th e C O T S s o f tw a re a n d th e d a ta b a s e sin th e c o n te x t o f o n e " b u s in e s s t r a n s a c t io n " , t h e w o rk lo a d sa s s o c ia t e d w i th t r a n s a c t io n s in C O T S b a s e d e n v i ro n m e n t s

    50%

    g ~t, -

    tt~ 10%E 0%e"o . 2 0 %i 30%

    -40%

    ~-10%

    -50% Wo r k l o a d per T r a ns a c ti o nFigure 6 : Enqueue Response Time Improvem ent

    S I G M O D R e c o r d , V o l . 2 8 , N o . 3 , S e p t e m b e r 1 9 9 9 5 3

  • 8/14/2019 Distributed Transactions in Practice

    6/7

    t en d t o b e o n t h e l a rg e r s i d e . As men t io n ed b efo re weh o s t ed t h e q u eu e an d t h e d a tab ases o n d i f f e r en t mach in es soth a t th ey d o n o t co mp ete o n I /O in t h e NT se rv er s . A s i d eef f ec t o f th i s i s t h a t al l t he en q u eu e o p era t i o n s b e tw een t h eq u eu e an d t h e d a t ab ase n o w u se t h e n e two rk t o ex ecu t e t h e2 P C m ech an i sm. In l a rg e r p ro d u c t i o n st r en g th mach in es ,t h e q u eu es an d t h e d a t ab ases wi l l mo s t l y l i k e ly b e i n t h esame co mp u te r t h o u g h t h ey a r e l i k e ly t o b e l o ca t ed o nd i f f e r en t I /O su b - sy st ems . S o t h e en q u eu e sav in g s sh o w n inF ig u re 6 a r e l i k e ly t o b e h ig h er i n p ro d u c t i o n sy s t ems t h ano u r r esu l t s wo u ld i n d i ca te .

    1 2 0 0 0-B-Q 10

    ~ o o o 0 - B - 2 P C 1 0 f /_= - ~ - Q 1 5 0~ o o - + - 2 P C 1 5 0o

    1 2 3 4 5 6 7 8 9 l ON u m b e r o f C o n c u r r e n t T r a n s a c t i o n sF i g u r e 7 : R e s p o n s e T im e - 2 P C V s . Q u e u e

    F i g u r e 7 c o m p a r e s t h e r e s p o n s e t i m e o f 2 P Cco o rd in a t ed t r an sac t i o n s v s . q u eu e b ased asy n ch ro n o u st r an sac t i o n s s imi l a r t o t h a t d esc r i b ed i n t h e p rev io u sp arag rap h . Un l ik e F ig u re 6 , F ig u re 7 co mp ares t h e twoap p ro a ch es wh en co n cu r r en t t r an sac t io n s (v a r i ed f ro m 1 -1 0 )a re ex ecu t ed . W e r an ex p er imen t s fo r sev era l wo rk lo ad sb u t o n ly sh o w th e r esu l t s f ro m rep resen t a t i v e o f smal l ( 1 0in se r t s / t r an sac t i o n ) , med iu m (1 5 0 i n se r t s / t r an sac t i o n ) an dl a rg e (5 0 0 i n se rt s / tr an sac t i o n ) wo rk lo ad s . As t h e n u m b er o fco n c u r r en t t r an sac t io n s i n c reases , t h e r esp o n se t ime o f eacht r an sac t i o n d eg rad es as an t i c i p a ted fo r b o th ap p ro ach es . I ng en era l fo r smal l e r s i zed wo rk lo ad s , 2 P C co o rd in a t edt r an sac t i o n s r e tu rn ed a b e t t e r r esp o n se t ime . I t may a l so b eo b serv ed t h a t t h e q u eu e messag e o v erh ead i s q u i t es i g n i f i can t fo r l o wer wo rk lo ad s an d mak e t h em u n a t t r ac t i v ein t h ese wo rk lo ad r an g es . F o r t h e l a rg es t wo rk lo ad i n F ig u re7 , t h e q u eu e r esp o n se t ime f l a t t en s a f t e r 5 co n cu r r en tt r an sac t i o n s . Th i s i s b ecau se t h e q u eu e g e t s sa tu ra t ed wi thth e l a rg e r messag es an d t h e se rv i ce t h a t p e r fo rms d a t ab asein se r t s b eco m es t h e b o t t l en eck . W e an t i c i p a te t h a t fo r smal lan d m ed iu m s i ze wo rk lo ad s , i f we fu r t h e r i n c rease t h en u m b er o f co n cu r r en t t r an sac t i o n s, t h e q u eu e r esp o n se t imewi l l f l a t t en o u t b u t t h e 2 P C resp o n se t ime wi l l co n t i n u e t og ro w l i n ea r ly . Th e r esp o n se t ime o f t h e q u eu e b asedt r an sac t i o n s a r e a l so n eg a t i v e ly imp ac t ed b y t h e ex p er imen tco n f ig u ra t i o n i s su e ( r emo te d a t ab ase an d q u eu e) t h a t wasd i scu ssed ea r l i e r an d t h e r esp o n se t ime wi l l b e b e t t e r o np ro d u c t i o n s t r en g th mach in es .

    F ig u re 8 co mp ares t h e t h ro u g h p u t s b e tween 2 P Cco o rd in a t ed t r an sac t io n s an d q u eu e b ase d t r an sac t i o n s fo r 1 -1 0 co n cu r r en t c l i ent s . W e mea su red t h ro u g h p u t as t h en u m b er o f su ccess fu l t r an sac t i o n s ex ecu t ed wi th in a f i x edt ime i n t e rv a l . F o r t h e q u eu e b ased t r an sac t i o n s , we i n i t ia t edth e en q u eu e o p era t i o n s (1 -1 0 p ro cesses ) an d a f t e r a b r i e ft ime l ag , we i n i t i a t ed t h e d eq u eu e o p era t i o n s (1 -1 0p ro cesses ) t o av o id s t a rv a t i o n o f t h e d eq u eu e p ro cesses .S imi l a r t o t h e en q u eu e o p era t i o n s o f F ig u re 6 an d 7 , t h ed eq u eu e o p era t i o n s co n s i s t s o f d eq u e u in g a mes sag e f ro mth e q u eu e , i n se r ti n g th e wo rk lo ad n u mb er o f r eco rd s i n to ad a t ab ase , an d t h en p er fo rmin g a d i s t r i b u t ed 2 P C b e tweenth e q u eu e an d t h e lo ca l d a tab ase . F o r t h e same wo rk lo ad so f F ig u re 7 , a s an t i c ip a t ed t h e t h ro u g h p u t s were i n v e r se lyp ro p o r t i o n a l to t h e s ize o f t h e wo rk lo ad s . I n g en era l , th eth ro u g h p u t s as so c i a t ed wi th t h e q u eu e was b e t t e r fo r a l lwo rk lo ad s ex cep t fo r v e ry smal l wo rk lo ad s . Th eth ro u g h p u t s o f t h e q u eu e b ased t r an sac t i o n s a r e f i a t i nF ig u re 8 b ecau se t h e q u eu e i s k ep t b u sy an d c lo se t osa tu ra t i o n. On e wo u ld ex p ec t t h e t h ro u g h p u t s t o d ro p o f fa f t e r t h e p r o c e s s s c h e d u l e r o n t h e m a c h i n e b e c o m e so v erwh e lmed wi th t h e l a rg e r n u mb er o f co n cu r r en t c l i en t s .W e d id n o t reach t h i s limi t ev en w h en we r an 1 5 co n cu r r en tc l i en t s (n o t sh o wn in f i g u res ) an d b eg an t o r each memo ryan d o th er mach in e l imi t a t i o n s fo r l a rg e r n u mb er o fco n cu r r en t c l i en t s .

    5 0 0 045004000

    o ~ 3 0 0 0~.2500p-0)20000. ~ 1 5 0 0

    1 0 0 050 0

    i - B - Q 1 0. . , r - i - I - 2 i ~ C 1 0- ~ - Q 5 0 0! - ~ - 2 P C _ 5 0 0

    I o ~ _ _ _ _ . _ ~ _ _ _ . a - - ~ = = - - - .. - - a - -_ _ = [] [ ] I

    J- J . .g .L J . J . J . J t1 2 3 4 5 6 7 8 9 10N u m b e r o f C o n c u r r e n t T r a n s a c t i o n s

    F i g u r e 8 : T h r o u g h p u t - 2 P C v s Q

    4 D i s c u s s i o n sTh i s p ap er ex amin es t h e imp ac t s o f a mu l t i - t i e r ed

    so f tware a r ch i t ec tu re o n t r an sac t i o n man ag emen t .S p ec i f i ca l l y , i n an y l a rg e sca l e en t e rp r i se sy s t em th a tco n s i s ts o f mu l t ip l e CO TS so f tware p ro d u c t s , t h eresp o n s ib i li t y o f p ro v id in g i n t e r f aces t o su p p o r t g lo b a lt r an sac t i o n co o rd in a t i o n i s a s su med b y COTS so f twarep ro d u c t s , i ns t ead o f b y t h e DBM S s . Th i s r eq u i r emen t ,h o wev er , i s n o t r ea l i zed s i n ce su p p o r t i n g h e t e ro g en eo u sg lo b a l t r an sac t i o n co o rd in a t i o n i s p ro h ib i t i v e i n b o th co s tan d p er fo rman ce t o en t e rp r i ses an d t o COTS so f twarev en d o r s a l i k e. En t e rp r i ses may c h o o se n o t t o u se an y g lo b a lt r an sac t i o n man ag emen t mech an i sms t o en fo rce d a t a

    5 4 S I G M O D R e c o r d , V o l . 2 8 , N o . 3 , S e p t e m b e r 1 9 99

  • 8/14/2019 Distributed Transactions in Practice

    7/7