mnesia - a dristibuted robust dbms for telecommunications applications

Upload: zvinca-dan-claudiu

Post on 07-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 Mnesia - A Dristibuted Robust DBMS for Telecommunications Applications

    1/15

    T a b l e o f C o n t e n t s

    M n e s i a

    M n e s i a A D i s t r i b u t e d R o b u s t D B M S f o r T e l e c o m m u n i c a t i o n s A p p l i c a t i o n s 1

    H a k a n M a t t s s o n , H a n s N i l s s o n a n d C l a e s W i k s t r o m

    A u t h o r I n d e x : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 3

    S u b j e c t I n d e x : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 3

  • 8/6/2019 Mnesia - A Dristibuted Robust DBMS for Telecommunications Applications

    2/15

  • 8/6/2019 Mnesia - A Dristibuted Robust DBMS for Telecommunications Applications

    3/15

    M n e s i a A D i s t r i b u t e d R o b u s t D B M S f o r

    T e l e c o m m u n i c a t i o n s A p p l i c a t i o n s

    H a k a n M a t t s s o n , H a n s N i l s s o n a n d C l a e s W i k s t r o m

    C o m p u t e r S c i e n c e L a b o r a t o r y

    E r i c s s o n T e l e c o m A B

    S - 1 2 5 2 6 S t o c k h o l m , S w e d e n

    f h a k a n , h a n s , k l a c k e g @ e r i x . e r i c s s o n . s e

    A b s t r a c t . T h e M n e s i a D B M S r u n s i n t h e s a m e a d r e s s s p a c e a s t h e

    a p p l i c a t i o n o w n i n g t h e d a t a , y e t t h e a p p l i c a t i o n c a n n o t d e s t r o y t h e c o n -

    t e n t s o f t h e d a t a b a s e . T h i s p r o v i d e s f o r b o t h f a s t a c c e s s e s a n d e c i e n t

    f a u l t t o l e r a n c e , n o r m a l l y c o n i c t i n g r e q u i r e m e n t s . T h e i m p l e m e n t a t i o n i s

    b a s e d o n f e a t u r e s i n t h e E r l a n g p r o g r a m m i n g l a n g u a g e , i n w h i c h M n e s i a

    i s e m b e d d e d .

    1 I n t r o d u c t i o n

    T h e m a n a g e m e n t o f d a t a i n t e l e c o m m u n i c a t i o n s s y s t e m h a s m a n y a s p e c t s w h e r e o f

    s o m e , b u t n o t a l l , a r e a d d r e s s e d b y t r a d i t i o n a l c o m m e r c i a l D B M S s D a t a B a s e

    M a n a g e m e n t S y s t e m s . I n p a r t i c u l a r t h e v e r y h i g h l e v e l o f f a u l t t o l e r a n c e w h i c h

    i s r e q u i r e d i n m a n y n o n s t o p s y s t e m s , c o m b i n e d w i t h r e q u i r e m e n t s o n t h e D B M S

    t o r u n i n t h e s a m e a d d r e s s s p a c e a s t h e a p p l i c a t i o n , h a v e l e d u s t o i m p l e m e n t a

    b r a n d n e w D B M S . T h i s p a p e r d e s c r i b e s t h e m o t i v a t i o n f o r , a s w e l l a s t h e d e s i g n

    o f t h i s n e w D B M S , c a l l e d M n e s i a . M n e s i a i s i m p l e m e n t e d i n , a n d v e r y t i g h t l y

    c o n n e c t e d t o , t h e p r o g r a m m i n g l a n g u a g e E r l a n g a n d i t p r o v i d e s t h e f u n c t i o n a l -

    i t y t h a t i s n e c e s s a r y f o r t h e i m p l e m e n t a t i o n o f f a u l t t o l e r a n t t e l e c o m m u n i c a t i o n s

    s y s t e m s . M n e s i a i s a m u l t i u s e r D i s t r i b u t e d D B M S s p e c i a l l y m a d e f o r i n d u s t r i a l

    t e l e c o m m u n i c a t i o n s a p p l i c a t i o n s w r i t t e n i n t h e s y m b o l i c p r o g r a m m i n g l a n g u a g e

    E r l a n g 1 w h i c h i s a l s o t h e i n t e n d e d t a r g e t l a n g u a g e . M n e s i a t r i e s t o a d d r e s s

    a l l o f t h e d a t a m a n a g e m e n t i s s u e s r e q u i r e d f o r t y p i c a l t e l e c o m m u n i c a t i o n s s y s -

    t e m s a n d i t h a s a n u m b e r o f f e a t u r e s t h a t a r e n o t n o r m a l l y f o u n d i n t r a d i t i o n a l

    d a t a b a s e s .

    I n t e l e c o m m u n i c a t i o n s a p p l i c a t i o n s t h e r e a r e n e e d s d i e r e n t f r o m t h e f e a t u r e s

    p r o v i d e d b y t r a d i t i o n a l D B M S s . T h e a p p l i c a t i o n s w e n o w s e e i m p l e m e n t e d i n

    t h e E r l a n g l a n g u a g e n e e d a m i x t u r e o f a b r o a d r a n g e o f f e a t u r e s w h i c h g e n e r a l l y

    a r e n o t s a t i s e d b y t r a d i t i o n a l D B M S s . M n e s i a i s d e s i g n e d w i t h r e q u i r e m e n t s

    l i k e t h e f o l l o w i n g i n m i n d :

    1 . F a s t r e a l t i m e k e y v a l u e l o o k u p .

    2 . C o m p l i c a t e d n o n r e a l t i m e q u e r i e s m a i n l y f o r o p e r a t i o n a n d m a i n t e n a n c e .

    3 . D i s t r i b u t e d d a t a d u e t o d i s t r i b u t e d a p p l i c a t i o n s .

    4 . H i g h f a u l t t o l e r a n c e .

  • 8/6/2019 Mnesia - A Dristibuted Robust DBMS for Telecommunications Applications

    4/15

    5 . D y n a m i c r e c o n g u r a t i o n .

    6 . C o m p l e x o b j e c t s .

    W h a t s e t s M n e s i a a p a r t f r o m m o s t o t h e r D B M S s i s t h a t i t i s d e s i g n e d w i t h

    t h e t y p i c a l d a t a m a n a g e m e n t p r o b l e m s o f t e l e c o m m u n i c a t i o n s a p p l i c a t i o n s i n

    m i n d . H e n c e M n e s i a c o m b i n e s m a n y c o n c e p t s f o u n d i n t r a d i t i o n a l d a t a b a s e s

    s u c h a s t r a n s a c t i o n s a n d q u e r i e s w i t h c o n c e p t s f o u n d i n d a t a m a n a g e m e n t s y s -

    t e m s f o r t e l e c o m m u n i c a t i o n s a p p l i c a t i o n s s u c h a s v e r y f a s t r e a l t i m e o p e r a t i o n s ,

    c o n g u r a b l e d e g r e e o f f a u l t t o l e r a n c e b y m e a n s o f r e p l i c a t i o n a n d t h e a b i l i t y

    t o r e c o n g u r e t h e s y s t e m w i t h o u t s t o p p i n g o r s u s p e n d i n g i t . M n e s i a i s a l s o i n -

    t e r e s t i n g d u e t o i t s t i g h t c o u p l i n g t o t h e p r o g r a m m i n g l a n g u a g e E r l a n g , t h u s

    a l m o s t t u r n i n g E r l a n g i n t o a d a t a b a s e p r o g r a m m i n g l a n g u a g e . T h i s h a s m a n y

    b e n e t s , t h e f o r e m o s t b e i n g t h a t t h e i m p e d a n c e m i s m a t c h 5 b e t w e e n d a t a f o r -

    m a t u s e d b y t h e D B M S a n d d a t a f o r m a t u s e d b y t h e p r o g r a m m i n g l a n g u a g e

    w h i c h i s b e i n g u s e d t o m a n i p u l a t e t h e d a t a , c o m p l e t e l y d i s a p p e a r s .

    M n e s i a i s c u r r e n t l y u s e d i n a l m o s t a l l E r l a n g b a s e d p r o j e c t s w i t h i n E r i c s s o n

    r a n g i n g f r o m s m a l l s c a l e p r o t o t y p e p r o j e c t s t o m a j o r s w i t c h i n g p r o d u c t p r o j e c t s .

    T h e r e m a i n d e r o f t h i s p a p e r i s o r g a n i z e d a s f o l l o w s . S e c t i o n 2 i s a b r i e f

    o v e r v i e w o f t h e D B M S . S e c t i o n 3 i s o r g a n i z e d a s a l i s t i n g o f t y p i c a l D B M S

    f u n c t i o n a l i t i e s , a d i s c u s s i o n o f s o m e t e l e c o m m u n i c a t i o n s a s p e c t o n t h e f u n c t i o n -

    a l i t y a n d h o w t h e f u n c t i o n a l i t y i s p r o v i d e d b y M n e s i a . S e c t i o n 4 c o n t a i n s s o m e

    p e r f o r m a n c e m e a s u r e m e n t s a n d n a l l y s e c t i o n 5 p r o v i d e s s o m e c o n c l u s i o n s .

    2 A b r i e f o v e r v i e w o f M n e s i a

    W e b r i e y o v e r v i e w t h e f e a t u r e s o f M n e s i a D B M S . M n e s i a i s b o t h a n e x t e n -

    s i o n o f t h e p r o g r a m m i n g l a n g u a g e E r l a n g a s w e l l a s a n E r l a n g a p p l i c a t i o n . T h e

    D B M S c o m p o n e n t s s u c h a s l o c k m a n a g e r , t r a n s a c t i o n m a n a g e r , r e p l i c a t i o n m a n -

    a g e r , l o g g e r , p r i m a r y a n d s e c o n d a r y m e m o r y s t o r a g e , b a c k u p s y s t e m , e t c a r e a l l

    i m p l e m e n t e d a s r e g u l a r E r l a n g p r o g r a m s . T h e q u e r y l a n g u a g e , h o w e v e r , i s i m -

    p l e m e n t e d a s a p a r t o f t h e a c t u a l E r l a n g s y n t a x , w h e r e a s t h e o p t i m i z i n g q u e r y

    c o m p i l e r a n d e v a l u a t o r a r e r e g u l a r E r l a n g p r o g r a m s . T h e d a t a m o d e l o f M n e s i a

    i s o f a h y b r i d t y p e : d a t a i s o r g a n i z e d a s t a b l e s o f r e c o r d s s i m i l a r t o r e l a t i o n s , b u t

    t h e a t t r i b u t e s o f t h e r e c o r d s i n c l u d i n g t h e k e y c a n h o l d a r b i t r a r i l y c o m p l e x

    c o m p o u n d d a t a s t r u c t u r e s s u c h a s t r e e s , f u n c t i o n s , c l o s u r e s , c o d e e t c . A s s u c h ,

    M n e s i a c o u l d b e c h a r a c t e r i z e d a s a s o c a l l e d o b j e c t - r e l a t i o n a l D B M S . L e t u s

    a s s u m e , a d e n i t i o n f o r a p e r s o n r e c o r d .

    - r e c o r d p e r s o n , n a m e , a t o m i c , u n i q u e k e y

    d a t a , c o m p o u n d u n s p e c i f i e d s t r u c t u r e

    m a r r i e d _ t o , n a m e o f p a r t n e r o r u n d e f i n e d

    c h i l d r e n . l i s t o f c h i l d r e n

    G i v e n t h i s r e c o r d d e n i t i o n , i t i s p o s s i b l e t o c r e a t e i n s t a n c e s o f t h e p e r s o n

    r e c o r d w i t h t h e f o l l o w i n g E r l a n g s y n t a x w h e r e

  • 8/6/2019 Mnesia - A Dristibuted Robust DBMS for Telecommunications Applications

    5/15

    X = p e r s o n n a m e = k l a c k e ,

    d a t a = m a l e , 3 6 , 9 7 1 1 9 1 ,

    m a r r i e d _ t o = e v a ,

    c h i l d r e n = m a r t e n , m a j a , k l a r a .

    b i n d s t h e v a r i a b l e X t o a n e w p e r s o n r e c o r d . T h e d a t a e l d i s b o u n d t o a

    t u p l e m a l e , 3 6 , 9 7 1 1 9 1 w i t h t h r e e p a r t s . T h i s i s a n e x a m p l e o f a c o m p l e x

    o b j e c t , a n d M n e s i a p u t s n o c o n s t r a i n t s o n t h e c o m p l e x i t y w h i c h i s a l l o w e d o n

    a t t r i b u t e s . W e c a n e v e n h a v e f u n c t i o n o b j e c t s w i t h v a r i a b l e c l o s u r e s a s a t t r i b u t e

    v a l u e s . T h e v a r i a b l e X i s m e r e l y a n E r l a n g t e r m , a n d i n o r d e r t o i n s e r t i t i n t o

    t h e d a t a b a s e , i t m u s t b e w r i t t e n :

    m n e s i a : w r i t e X

    S e r i e s o f M n e s i a o p e r a t i o n s c a n b e p e r f o r m e d t o g e t h e r a s a n a t o m i c t r a n s -

    a c t i o n . I n o r d e r t o h a v e M n e s i a e x e c u t e a t r a n s a c t i o n , t h e p r o g r a m m e r m u s t

    c o n s t r u c t a f u n c t i o n a l o b j e c t a n d t h e n p r e s e n t t h e M n e s i a s y s t e m w i t h t h a t

    f u n c t i o n a l o b j e c t s i m i l a r t o 7 . W e e x p l a i n t h i s b y a n e x a m p l e , a s s u m e w e w i s h

    t o w r i t e a n E r l a n g f u n c t i o n d i v o r c e N a m e w h i c h t a k e s t h e n a m e o f a p e r s o n ,

    n d s t h e p e r s o n f r o m t h e d a t a b a s e , a n d s e t s t h e m a r r i e d _ t o e l d f o r t h e p e r s o n

    a n d i t s p a r t n e r b a c k t o t h e u n d e n e d v a l u e .

    d i v o r c e N a m e -

    F = f u n

    c a s e m n e s i a : r e a d N a m e o f

    m n e s i a : a b o r t n o _ s u c h _ p e r s o n ;

    P e r s

    P a r t n e r = m n e s i a : r e a d P e r s p e r s o n . m a r r i e d _ t o ,

    m n e s i a : w r i t e P e r s p e r s o n m a r r i e d _ t o = u n d e f i n e d ,

    m n e s i a : w r i t e P a r t n e r p e r s o n m a r r i e d _ t o = u n d e f i n e d

    e n d

    e n d ,

    m n e s i a : t r a n s a c t i o n F .

    T h e d i v o r c e 1 f u n c t i o n c o n s i s t s o f t w o s t a t e m e n t s , t h e r s t F = . . . . s t a t e -

    m e n t c r e a t e s a f u n c t i o n o b j e c t , i t d o e s n o t e x e c u t e a n y t h i n g , i t m e r e l y c o n s t r u c t s

    a n a n o n y m o u s f u n c t i o n . T h e s e c o n d s t a t e m e n t g i v e s t h i s f u n c t i o n a w a y t o t h e

    M n e s i a s y s t e m w h i c h e x e c u t e s t h e f u n c t i o n i n t h e c o n t e x t o f a t r a n s a c t i o n , a d -

    h e r i n g t o t r a d i t i o n a l t r a n s a c t i o n s e m a n t i c s 2 .

    T h e a c t u a l f u n c t i o n F r s t e x e c u t e s a r e a d o p e r a t i o n t o n d t h e p e r s o n w i t h

    t h e n a m e N a m e , i t t h e n e x e c u t e s a s e c o n d r e a d t o n d t h e p a r t n e r o f t h e r s t p e r -

    s o n , a n d n a l l y i t w r i t e s t w o n e w r e c o r d s i n t o t h e d a t a b a s e w i t h t h e m a r r i e d _ t o

    e l d s e t t o u n d e n e d . T h e s e t w o w r i t e o p e r a t i o n s w i l l e e c t i v e l y o v e r w r i t e t h e

    o l d v a l u e s . T h e f u n c t i o n d i v o r c e 1 r e t u r n s t h e v a l u e o f t h e t r a n s a c t i o n , w h i c h

    i s e i t h e r a b o r t e d , R e a s o n o r a t o m i c , V a l u e d e p e n d i n g o n w h e t h e r t h e

    t r a n s a c t i o n w a s a b o r t e d o r n o t .

  • 8/6/2019 Mnesia - A Dristibuted Robust DBMS for Telecommunications Applications

    6/15

    Q u e r i e s i n M n e s i a a r e e x p r e s s e d w i t h a l i s t c o m p r e h e n s i o n s y n t a x 1 5 . A

    q u e r y t o n d t h e n a m e s o f a l l p e r s o n s w i t h m o r e t h a n X c h i l d r e n i s f o r m u l a t e d

    a s :

    q u e r y P . n a m e | | P t a b l e p e r s o n ,

    l e n g t h P . c h i l d r e n X

    e n d

    T h i s s h o u l d b e r e a d a s : c o n s t r u c t t h e l i s t o f P . n a m e ' s s u c h t h a t P i s t a k e n

    f r o m t h e t a b l e o f p e r s o n s , a n d l e n g t h o f t h e c h i l d r e n l i s t i s g r e a t e r t h a n X . I t i s

    i n d e e d b o t h p o s s i b l e a n d n a t u r a l t o m i x a q u e r y w i t h u s e r d e n e d p r e d i c a t e s .

    A s s u m e a f u n c t i o n :

    m a t u r e p S e x , A g e , P h o n e w h e n A g e 3 0

    t r u e ;

    m a t u r e p S e x , A g e , P h o n e

    f a l s e .

    T h e n t h e q u e r y :

    q u e r y P . n a m e | | P - t a b l e p e r s o n ,

    m a t u r e p P . d a t a ,

    l e n g t h P . c h i l d r e n X

    e n d

    e x t r a c t s a l l p e r s o n s w i t h m o r e t h a n X c h i l d r e n a n d w h e r e t h e s e c o n d e l e m e n t

    o f t h e d a t a e l d i s l a r g e r t h a n 3 0 . I t i s a l s o p o s s i b l e t o d e n e r u l e s w i t h a n

    e m b e d d e d l o g i c l a n g u a g e s i m i l a r t o D a t a l o g 1 6 . I f w e d e n e t h e r u l e :

    o l d i e s N a m e : -

    P - t a b l e p e r s o n ,

    m a t u r e p P . d a t a ,

    N a m e = P . n a m e .

    T h i s d e n e s a r u l e , w h i c h t h e n a c t s a s a v i r t u a l t a b l e a n d a p p l i c a t i o n p r o -

    g r a m s c a n a c c e s s t h e v i r t u a l t a b l e o l d i e s . T h e v i r t u a l o l d i e s t a b l e c o n t a i n s a

    s u b s e t o f t h e r e a l p e r s o n t a b l e . T h i s i s s i m i l a r t o , b u t m o r e p o w e r f u l t h a n ,

    t h e c o n c e p t o f v i e w s f o u n d i n r e l a t i o n a l d a t a b a s e s . Q u e r i e s a r e c o m p i l e d b y a n

    o p t i m i z i n g q u e r y c o m p i l e r w h i c h h a s b e e n i n t e g r a t e d w i t h t h e n o r m a l E r l a n g

    c o m p i l e r .

    T a b l e s c a n b e r e p l i c a t e d t o s e v e r a l s i t e s o r n o d e s . T h e n e t w o r k o f n o d e s

    c a n b e a h e t e r o g e n e o u s n e t w o r k . R e p l i c a t i o n i s t h e m e c h a n i s m w h e r e b y w e c a n

    c o n s t r u c t f a u l t t o l e r a n t s y s t e m s . A c c e s s t o a t a b l e i s l o c a t i o n t r a n s p a r e n t , t h a t

    i s , p r o g r a m s d o n o t h a v e t o h a v e e x p l i c i t k n o w l e d g e o f t h e l o c a t i o n o f d a t a . A

    t a b l e h a s a u n i q u e n a m e a n d c e r t a i n p r o p e r t i e s , w e h a v e t h e f o l l o w i n g l i s t o f

    p r o p e r t i e s a t t a c h e d t o e a c h t a b l e .

  • 8/6/2019 Mnesia - A Dristibuted Robust DBMS for Telecommunications Applications

    7/15

    t y p e c o n t r o l s w h e t h e r t h e t a b l e h a s s e t o r b a g s e m a n t i c s . A s e t h a s u n i q u e

    k e y s , w h e r e a s a b a g c a n h a v e s e v e r a l o b j e c t s w i t h t h e s a m e k e y .

    r a m c o p i e s a l i s t o f M n e s i a n o d e s w h e r e r e p l i c a s o f t h e t a b l e a r e h e l d i n r a m

    o n l y .

    d i s c c o p i e s a l i s t o f M n e s i a n o d e s w h e r e r e p l i c a s o f t h e t a b l e a r e h e l d e n t i r e l y

    i n r a m , b u t a l l u p d a t e o p e r a t i o n s o n t h e t a b l e a r e l o g g e d t o d i s c .

    d i s c o n l y c o p i e s a l i s t o f M n e s i a n o d e s w h e r e r e p l i c a s o f t h e t a b l e a r e h e l d

    o n d i s c o n l y . T h e s e r e p l i c a s a r e o f c o u r s e c o n s i d e r a b l y s l o w e r t h a n r e p l i c a s

    h e l d i n r a m .

    i n d e x a l i s t s p e c i f y i n g o n w h i c h a t t r i b u t e s o f t h e r e c o r d i n d e x i n f o r m a t i o n

    s h a l l b e m a i n t a i n e d . A l l r e c o r d s a r e a l w a y s a u t o m a t i c a l l y i n d e x e d o n t h e

    p r i m a r y k e y .

    s n m p c o n t r o l s w h e t h e r t h e t a b l e s h a l l b e p o s s i b l e t o m a n i p u l a t e t h r o u g h t h e

    S i m p l e N e t w o r k M a n a g e m e n t P r o t o c o l p r o t o c o l 4 .

    D e s c r i p t i o n s o f a l l t a b l e s a r e k e p t i n a d a t a b a s e s c h e m a a n d M n e s i a h a s

    a m u l t i t u d e o f f u n c t i o n s t o m a n i p u l a t e t h e s c h e m a d y n a m i c a l l y . T a b l e s c a n b e

    c r e a t e d , m o v e d , r e p l i c a t e d , c h a n g e d , d e s t r o y e d e t c . F u r t h e r m o r e a l l t h e s e s y s t e m

    a c t i v i t i e s a r e p e r f o r m e d i n t h e b a c k g r o u n d a n d t h u s a l l o w s t h e a p p l i c a t i o n t o

    u t i l i z e t h e s y s t e m a s u s u a l a l t h o u g h t h e s y s t e m i t s e l f i s b e i n g c h a n g e d .

    B a c k u p s c a n b e c o n s t r u c t e d o f t h e e n t i r e d i s t r i b u t e d s y s t e m , t h e s e b a c k u p s

    c a n b e i n s t a l l e d a s f a l l b a c k s . T h i s m e a n s t h a t i f t h e s y s t e m s h o u l d c r a s h , t h e

    d a t a b a s e w i l l a u t o m a t i c a l l y b e r e c r e a t e d f r o m t h e f a l l b a c k .

    3 D B M S f e a t u r e d i s c u s s i o n

    D i e r e n t D B M S s h a v e d i e r e n t f e a t u r e s a n d c h a r a c t e r i s t i c s . T h i s s e c t i o n i s o r -

    g a n i z e d a s a l i s t i n g o f d i e r e n t D B M S c h a r a c t e r i s t i c s a n d a s h o r t d i s c u s s i o n o f

    t h e i m p o r t a n c e a n d n e c e s s i t y i n o u r i n t e n d e d a p p l i c a t i o n d o m a i n .

    3 . 1 C o m p l e x v a l u e s

    T h e a b i l i t y t o h a n d l e c o m p l e x v a l u e s , s u c h a s l i s t s , s e t s , t r e e s , e t c e c i e n t l y

    a n d n a t u r a l l y i n t h e D B M S i s p r o b a b l y t h e s i n g l e m o s t i m p o r t a n t f e a t u r e f o r

    a t e l e c o m m u n i c a t i o n s D B M S . T e l e c o m m u n i c a t i o n s a p p l i c a t i o n s w h i c h h a n d l e

    t r a c a r e u s u a l l y d r i v e n b y e x t e r n a l s t i m u l i w h i c h a r r i v e s a t t h e s y s t e m . W h e n

    s u c h a s t i m u l i a r r i v e s i n t h e f o r m o f a P D U P r o t o c o l D a t a U n i t t o t h e s y s t e m ,

    t h e P D U i s d e c o d e d a n d s o m e a p p r o p r i a t e a c t i o n m u s t b e t a k e n . W h e n t h e P D U

    h a s b e e n d e c o d e d , t h e s y s t e m u s u a l l y h a s t o r e t r i e v e s o m e d a t a o b j e c t , p o s s i b l y

    a s u b s c r i b e r r e c o r d w h i c h i s u s e d t o d e c i d e w h a t a c t i o n s h o u l d b e t a k e n i n

    r e s p o n s e t o t h e r e c e i v e d P D U . I n m a n y t e l e c o m m u n i c a t i o n s s y s t e m s t h e s i n g l e

    m o s t i m p o r t a n t f e a t u r e o f t h e d a t a m a n a g e m e n t s y s t e m i s t h a t t h i s l o o k u p

    o p e r a t i o n i s v e r y e c i e n t . I t i s a l s o i m p o r t a n t t h a t t h e D B M S a l l o w s t h e d a t a

    t o b e s t r u c t u r e d a n d s t o r e d i n s u c h a w a y s o t h a t r e l e v a n t d a t a c a n b e a c c e s s e d i n

    a s i n g l e l o o k u p o p e r a t i o n . T h i s f a c t m a k e s i t h a r d t o m o d e l t e l e c o m m u n i c a t i o n s

  • 8/6/2019 Mnesia - A Dristibuted Robust DBMS for Telecommunications Applications

    8/15

    s y s t e m w i t h t r a d i t i o n a l r e l a t i o n a l d a t a b a s e s . O r g a n i z i n g t h e t e l e c o m m u n i c a t i o n s

    d a t a i n t h i r d o r e v e n r s t n o r m a l f o r m i s u s u a l l y n o t p o s s i b l e .

    T h i s i s o n e o f t h e r e a s o n s w h y t h e t e l e c o m m u n i c a t i o n s i n d u s t r y h a v e p a y e d s o

    m u c h a t t e n t i o n t o o b j e c t - o r i e n t e d d a t a b a s e s y s t e m s w h i c h a l l o w s t h e d a t a t o b e

    o r g a n i z e d i n a m o r e e x i b l e w a y t h a n r e l a t i o n a l d a t a b a s e s y s t e m s . T h u s M n e s i a

    a l l o w s t h e u s e r t o u s e a r b i t r a r i l y c o m p l e x o b j e c t s b o t h a s a t t r i b u t e v a l u e s b u t

    a l s o a s k e y v a l u e s i n t h e d a t a b a s e .

    3 . 2 D a t a f o r m a t a n d a d d r e s s s p a c e

    M a n y d a t a b a s e s u s e a n i n t e r n a l , l a n g u a g e i n d e p e n d e n t f o r m a t t o s t o r e d a t a . T h i s

    i s m o s t u n f o r t u n a t e i n t e l e c o m m u n i c a t i o n s s y s t e m s d u e t o t h e p r e v i o u s l y m e n -

    t i o n e d f a s t l o o k u p r e q u i r e m e n t . M a n y o b j e c t o r i e n t e d D B M S s a r e t i g h t l y c o u p l e d

    t o a p r o g r a m m i n g l a n g u a g e l i k e C + + o r S m a l l t a l k . T h e a b i l i t y t o m a n i p u l a t e

    r e g u l a r p r o g r a m m i n g l a n g u a g e o b j e c t s i n t h e d a t a b a s e , m a k e s t h e i m p e d a n c e

    m i s m a t c h d i s a p p e a r . T h i s n o t o n l y e a s e s t h e m a n i p u l a t i o n o f t h e D B M S b u t i t

    a l s o p r o v i d e s a n o p p o r t u n i t y t o i m p l e m e n t v e r y e c i e n t l o o k u p o p e r a t i o n s s i n c e

    a l o o k u p c a n i m m e d i a t e l y r e t u r n a p o i n t e r t o t h e o b j e c t b y m e a n s o f t h e p r o -

    g r a m m i n g l a n g u a g e b e i n g u s e d . I f w e f o r e x a m p l e w a n t t o i m p l e m e n t a r o u t i n g

    t a b l e a s a d a t a b a s e t a b l e , i t i s n o t r e a l i s t i c t o t r a n s f o r m t h e r o u t i n g d a t a b a c k

    a n d f o r t h f r o m a n a n e x t e r n a l D B M S f o r m a t f o r e a c h p a c k e t w e n e e d t o r o u t e .

    F u r t h e r m o r e i t i s n o t r e a l i s t i c t o p e r f o r m a n y c o n t e x t s w i t c h e s a n d s e a r c h t h e

    r e l e v a n t d a t a f o r e a c h p a c k e t i n a p r o c e s s e x e c u t i n g i n a n o t h e r a d d r e s s s p a c e .

    T h i s e e c t i v e l y r u l e s o u t a l l D B M S s t h a t c a n n o t b e d i r e c t l y l i n k e d i n t o t h e a d -

    d r e s s s p a c e o f t h e a p p l i c a t i o n , a s w e l l a s a l l D B M S s t h a t a r e l i n k e d i n t o t h e

    a p p l i c a t i o n b u t u s e a l a n g u a g e i n d e p e n d e n t f o r m a t t o s t o r e d a t a .

    T h e m a j o r d i s a d v a n t a g e o f l e t t i n g t h e a p p l i c a t i o n r u n i n t h e s a m e a d d r e s s

    s p a c e a s t h e D B M S i s t h a t i f t h e a p p l i c a t i o n s h o u l d c r a s h d u e t o a p r o g r a m -

    m i n g e r r o r , t h e D B M S m a y n o t b e g i v e n t h e o p p o r t u n i t y t o s t o r e v i t a l d a t a t o

    s e c o n d a r y s t o r a g e b e f o r e t e r m i n a t i n g . T h i s m e a n s t h a t t h e e n t i r e D B M S m u s t

    b e r e c o v e r e d b e f o r e s t a r t i n g u p a g a i n . T h i s i s u s u a l l y a t i m e c o n s u m i n g p r o c e s s

    a n d i n t e l e c o m m u n i c a t i o n s s y s t e m , t h e d o w n t i m e m u s t b e s h o r t . W e a v o i d t h i s

    p r o b l e m s i n c e t h e a p p l i c a t i o n s a s w e l l a s t h e D B M S a r e i m p l e m e n t e d i n t h e E r -

    l a n g l a n g u a g e . A n E r l a n g a p p l i c a t i o n c a n n o t c r a s h i n s u c h a w a y t h a t i t e e c t s

    t h e D B M S . T h e a p p l i c a t i o n r u n i n t h e s a m e a d d r e s s s p a c e a s t h e D B M S , b u t

    E r l a n g i t s e l f m a k e s i t i m p o s s i b l e f o r t h e c r a s h o f o n e a p p l i c a t i o n t o e e c t a n

    o t h e r a p p l i c a t i o n . E r l a n g p r o c e s s e s h a v e t h e e c i e n c y a d v a n t a g e o f r u n n i n g i n

    t h e s a m e a d d r e s s s p a c e b u t t h e y d o n o t h a v e t h e p o s s i b i l i t y t o e x p l i c i t l y r e a d o r

    w r i t e e a c h o t h e r s m e m o r y .

    3 . 3 F a u l t t o l e r a n c e

    M a n y t e l e c o m m u n i c a t i o n s a p p l i c a t i o n s a r e n o n s t o p s y s t e m s . T h e s y s t e m m u s t

    b e a b l e t o c o n t i n u e t o p r o v i d e i t s s e r v i c e s e v e n i f a n u m b e r o f h a r d w a r e o r s o f t -

    w a r e e r r o r s o c c u r . T h i s a d d s r e q u i r e m e n t s n o t o n l y t o t h e D B M S , b u t a l s o t o t h e

  • 8/6/2019 Mnesia - A Dristibuted Robust DBMS for Telecommunications Applications

    9/15

    t e l e c o m m u n i c a t i o n a p p l i c a t i o n i t s e l f . I t i n u e n c e s t h e d e s i g n o f t h e e n t i r e a p p l i -

    c a t i o n a n d t h e D B M S m u s t p r o v i d e t h e a p p l i c a t i o n d e s i g n e r s w i t h m e c h a n i s m s

    w h e r e b y a s u c i e n t l y f a u l t t o l e r a n t s y s t e m c a n b e d e s i g n e d . T h e m e c h a n i s m

    p r o v i d e d b y M n e s i a i s t h e a b i l i t y t o r e p l i c a t e a t a b l e t o s e v e r a l n o d e s . A l l r e p l i -

    c a s o f a M n e s i a t a b l e a r e e q u a l a n d t h e r e i s t h u s n o c o n c e p t o f p r i m a r y a n d

    s t a n d b y c o p i e s a t t h e D B M S l e v e l . I f a t a b l e i s r e p l i c a t e d a l l w r i t e o p e r a t i o n s

    a r e a p p l i e d t o a l l r e p l i c a s f o r e a c h t r a n s a c t i o n . I f s o m e r e p l i c a s a r e n o t a v a i l a b l e

    t h e w r i t e o p e r a t i o n s w i l l s u c c e e d a n y w a y a n d t h e m i s s i n g r e p l i c a s w i l l b e l a t e r

    u p d a t e d w h e n t h e y a r e r e c o v e r e d . T h i s m e c h a n i s m m a k e s i t p o s s i b l e t o d e s i g n

    s y s t e m s w h e r e s e v e r a l g e o g r a p h i c a l l y d i s t i n c t s y s t e m s c o o p e r a t e t o p r o v i d e a

    c o n t i n u o u s l y r u n n i n g n o n s t o p s y s t e m . M a n y o t h e r h i g h l y f a u l t t o l e r a n t s y s t e m s

    l i k e C l u s t R a 1 1 a l s o p r o v i d e f a u l t t o l e r a n c e t h r o u g h m e a n s o f r e p l i c a t i o n . H o w -

    e v e r , t h e y d o n o t h a v e t h e a b i l i t y t o e x e c u t e i n t h e s a m e a d d r e s s s p a c e a s t h e

    a p p l i c a t i o n .

    M n e s i a c a n a l s o r e c o v e r p a r t i a l l y f r o m c o m p l e t e d i s a s t e r s . A l l o b j e c t s t h a t

    a r e w r i t t e n t o d i s c , a r e c o d e d i n s u c h a w a y t h a t i t i s p o s s i b l e t o s a f e l y d i s t i n g u i s h

    d a t a f r o m g a r b a g e . T h i s m a k e s i t p o s s i b l e t o s c a n a d a m a g e d o r c r a s h e d d i s c o r

    l e s y s t e m a n d r e t r i e v e d a t a f r o m t h e c r a s h e d d i s c .

    3 . 4 D i s t r i b u t i o n a n d l o c a t i o n t r a n s p a r e n c y

    M n e s i a i s a t r u l y d i s t r i b u t e d D B M S w h e r e d a t a c a n b e r e p l i c a t e d o r s i m p l y r e s i d e

    r e m o t e l y . I n s u c h a n e n v i r o n m e n t i t i s i m p o r t a n t t h a t t h e D B M S p r o g r a m m e r

    c a n a c c e s s d a t a w i t h o u t e x p l i c i t k n o w l e d g e a b o u t t h e l o c a t i o n o f d a t a . T h a t i s ,

    l o c a t i o n t r a n s p a r e n c y o f d a t a i s i m p o r t a n t . O n t h e o t h e r h a n d , s i n c e i t i s m o s t

    c e r t a i n l y m o r e e x p e n s i v e t o a c c e s s d a t a r e m o t e l y , i t m u s t a l s o b e p o s s i b l e f o r

    t h e a p p l i c a t i o n p r o g r a m m e r t o e x p l i c i t l y n d t h i s l o c a t i o n i n f o r m a t i o n i n o r d e r

    t o e x e c u t e t h e p r o g r a m w h e r e t h e d a t a i s . H e n c e , w e w a n t t o p r o v i d e l o c a t i o n

    t r a n s p a r e n c y a s w e l l a s t h e a b i l i t y t o e x p l i c i t l y l o c a t e d a t a . D i e r e n t a p p l i c a t i o n s

    h a v e d i e r e n t r e q u i r e m e n t s .

    M n e s i a a p p l i c a t i o n s w h i c h a c c e s s t a b l e s b y u s i n g t h e n a m e o f t h e t a b l e o n l y ,

    w o r k r e g a r d l e s s o f t h e l o c a t i o n o f t h e t a b l e . T h e s y s t e m k e e p s t r a c k o f w h e r e

    d a t a i s r e p l i c a t e d . H o w e v e r , i t i s a l s o p o s s i b l e f o r t h e M n e s i a p r o g r a m m e r t o

    q u e r y t h e s y s t e m f o r t h e l o c a t i o n o f a t a b l e , a n d t h e n e x e c u t e t h e c o d e r e m o t e l y

    i n s t e a d . T h i s c a n b e d o n e b y s e n d i n g t h e c o d e t o t h e r e m o t e s i t e o r b y e n s u r i n g

    t h a t t h e c o d e i s p r e l o a d e d t h e r e .

    3 . 5 T r a n s a c t i o n s a n d A C I D

    D B M S s h a v e A C I D p r o p e r t i e s , A t o m i c i t y , C o n s i s t e n c y , I s o l a t i o n a n d D u r a b i l i t y .

    T h e s e p r o p e r t i e s a r e i m p l e m e n t e d b y m e a n s o f t r a n s a c t i o n s , w r i t e a h e a d l o g g i n g

    a n d r e c o v e r y i n M n e s i a . M o s t M n e s i a t r a n s a c t i o n s c o n s i s t s o f s e r i e s o f o p e r a t i o n s

    o n r a m o n l y p o s s i b l y r e p l i c a t e d t a b l e s . T h e s e t r a n s a c t i o n s d o n o t i n t e r a c t w i t h

    t h e d i s c s t o r a g e s y s t e m a t a l l , h e n c e t h e D u r a b i l i t y p r o p e r t y i s n o t f u l l l e d

    f o r t h e s e t r a n s a c t i o n s . A n e x a m p l e w h e r e t r a n s a c t i o n s e m a n t i c s a r e r e q u i r e d

    i n t e l e c o m m u n i c a t i o n s y s t e m s i s w h e n w e a d d a n e w s u b s c r i b e r t o t h e s y s t e m .

  • 8/6/2019 Mnesia - A Dristibuted Robust DBMS for Telecommunications Applications

    10/15

    W h e n w e d o t h i s , s e v e r a l r e s o u r c e s a r e a l l o c a t e d i n t h e s y s t e m , a n d s e v e r a l d a t a

    o b j e c t s a r e w r i t t e n i n t o t h e m e m o r y o f t h e s y s t e m . I t i s v i t a l t h a t a l l o f t h e s e

    o p e r a t i o n s a r e p e r f o r m e d a s o n e s i n g l e a t o m i c a c t i o n . O t h e r w i s e t h e s y s t e m c o u l d

    e n d u p i n a n i n c o n s i s t e n t s t a t e w i t h p o s s i b l y u n r e l e a s e d r e s o u r c e s .

    3 . 6 T h e a b i l i t y t o b y p a s s t h e t r a n s a c t i o n m a n a g e r

    T h e o v e r h e a d f o r a t r a n s a c t i o n i s q u i t e h i g h a n d f o r c e r t a i n p a r t s o f t r a c

    h a n d l i n g a p p l i c a t i o n s , i t i s s i m p l y n o t f e a s i b l e t o u s e a t r a n s a c t i o n s y s t e m t o

    a c c e s s t h e d a t a . C o n s e q u e n t l y , a D B M S t h a t i s s u i t a b l e f o r t e l e c o m m u n i c a t i o n s

    m u s t b e a b l e t o s u p p o r t b o t h a t o m i c t r a n s a c t i o n s c o n s i s t i n g o f s e r i e s o f d a t a b a s e

    o p e r a t i o n s a s w e l l a s v e r y l i g h t w e i g h t l o c k i n g o n t h e s a m e d a t a . T h e t r a c

    s y s t e m c o n s i s t s o f a n u m b e r o f t a b l e s . M a n y o f t h e s e t a b l e s a r e s e l d o m w r i t t e n

    b u t v e r y o f t e n r e a d . F o r e x a m p l e i t i s m o r e c o m m o n t o p r o c e s s a s i n g l e c a l l t h a n

    i t i s t o a d d a s u b s c r i b e r a n d i t i s m o r e c o m m o n t o r o u t e a P D U p a c k e t t h a n i t

    i s t o c h a n g e t h e r o u t i n g t a b l e s .

    W h e n w e e x e c u t e p e r f o r m a c e c r i t i c a l c o d e , w e d o n o t w a n t t o i m p o s e t h e

    o v e r h e a d o f a n e n t i r e t r a n s a c t i o n i n o r d e r t o r e a d d a t a . O n t h e c o n t r a r y , i f f o r

    e x a m p l e p a c k e t r o u t i n g c o d e r e a d s r o u t i n g i n f o r m a t i o n f r o m a r o u t i n g t a b l e

    w h i l e t h e r o u t i n g t a b l e i s b e i n g u p d a t e d , i t i s a c c e p t a b l e t h a t s o m e p a c k e t s g e t

    l o s t d u e t o t h i s a c c e s s c o n i c t . W h a t i s n e e d e d h e r e , i s v e r y l i g h t w e i g h t l o c k i n g

    p r o t e c t i o n s o t h a t a p p l i c a t i o n p r o c e s s e s c a n a c c e s s t h e d a t a t a b l e s a n d b e c e r t a i n

    t h a t e a c h d a t a o b j e c t t h a t i s r e a d , i s n o t g a r b l e d d u e t o c o n c u r r e n t w r i t e r s . T h i s

    i s s u p p o r t e d b y M n e s i a t h r o u g h a s o c a l l e d d i r t y i n t e r f a c e . I t i s p o s s i b l e t o

    r e a d , w r i t e a n d s e a r c h M n e s i a t a b l e s w i t h o u t p r o t e c t i n g t h e o p e r a t i o n i n s i d e a

    t r a n s a c t i o n . T h e s e d i r t y o p e r a t i o n s a r e t r u e r e a l t i m e D B M S o p e r a t i o n s : t h e y

    t a k e t h e s a m e p r e d i c t a b l e a m o u n t o f t i m e r e g a r d l e s s o f t h e s i z e o f t h e d a t a b a s e .

    3 . 7 Q u e r i e s

    A p a r t f r o m t r a c p r o c e s s i n g , t e l e c o m m u n i c a t i o n s s y s t e m s c o n t a i n s u b s t a n t i a l

    a m o u n t s o f o p e r a t i o n a l m a i n t e n a n c e O & M c o d e . F o r e x a m p l e , w h e n w e d e l e t e

    a s u b s c r i b e r f r o m a s w i t c h i n g s y s t e m , w e n e e d t o s e a r c h s e v e r a l t a b l e s f o r d a t a

    w h i c h i s a s s o c i a t e d w i t h t h i s s u b s c r i b e r , h e n c e t h e n e e d f o r a q u e r y l a n g u a g e .

    O p e r a t i o n a l a n d m a i n t e n a n c e c o d e i s c h a r a c t e r i z e d b y t h e f o l l o w i n g p r o p e r t i e s :

    1 . I t h a s n o n e o r v e r y l o w r e a l t i m e r e q u i r e m e n t s .

    2 . I t r e a d s , s e a r c h e s a n d m a n i p u l a t e s l a r g e p a r t s o f t h e t r a c d a t a .

    3 . I t c o n s t i t u t e s a l a r g e p a r t o f t h e c o d e v o l u m e o f t h e s y s t e m .

    4 . I t i s s e l d o m i f e v e r e x e c u t e d , t h u s s u b j e c t t o s o f t w a r e r o t a n d c o n s e q u e n t l y

    i n h e r e n t l y b u g g y .

    T h u s , a p o w e r f u l q u e r y l a n g u a g e w h i c h e x e c u t e s o n t h e t a r g e t s y s t e m a n d h a s

    c o m p l e t e a c c e s s t o a l l t r a c t a b l e s , c a n r e m e d y 3 b y m a k i n g t h e O & M c o d e

    s m a l l e r a n d 4 b y b e i n g d e c l a r a t i v e a n d b y b e i n g a b l e t o a u t o m a t i c a l l y a d a p t

    t o c h a n g e s i n t a b l e l a y o u t o r n e t w o r k t o p o l o g y . S i n c e a n o p t i m i z i n g c o m p i l e r i s

  • 8/6/2019 Mnesia - A Dristibuted Robust DBMS for Telecommunications Applications

    11/15

    u s e d t o d e c i d e t h e e x e c u t i o n o r d e r o f t h e q u e r y , O & M c o d e c a n a l s o b e c o m e

    m o r e e c i e n t .

    T h e M n e s i a q u e r y l a n g u a g e i s b a s e d o n l i s t c o m p r e h e n s i o n s . T h i s i d e a h a s

    b e e n e x p l o i t e d i n s e v e r a l o t h e r f u n c t i o n a l D B M S s s u c h a s 1 5 . T h e s y n t a x o f

    l i s t c o m p r e h e n s i o n s b l e n d p e r f e c t l y w i t h t h e E r l a n g p r o g r a m m i n g l a n g u a g e .

    3 . 8 S c h e m a a l t e r a t i o n

    T h e E r l a n g p r o g r a m m i n g l a n g u a g e h a s e x t e n s i v e s u p p o r t t o c h a n g e t h e c o d e o f

    e x e c u t i n g p r o c e s s e s w i t h o u t s t o p p i n g t h e p r o c e s s . I t i s p o s s i b l e t o c h a n g e t h e

    l a y o u t o r o r g a n i z a t i o n o f E r l a n g d a t a w i t h o u t s t o p p i n g t h e s y s t e m . T h u s , i t

    i s a l s o p o s s i b l e t o c h a n g e t h e M n e s i a s c h e m a a t r u n t i m e w i t h o u t s t o p p i n g t h e

    s y s t e m . S i n c e M n e s i a i s i n t e n d e d f o r n o n s t o p a p p l i c a t i o n s , a l l s y s t e m a c t i v i t i e s

    s u c h a s p e r f o r m i n g a b a c k u p , c h a n g i n g t h e s c h e m a , d u m p i n g t a b l e s t o s e c o n d a r y

    s t o r a g e a n d c o p y i n g r e p l i c a s h a v e t o b e p e r f o r m e d i n t h e b a c k g r o u n d w h i l e s t i l l

    a l l o w i n g t h e a p p l i c a t i o n s t o a c c e s s a n d m o d i f y t a b l e s a s u s u a l . W e b e l i e v e t h a t

    t h i s i s a r e q u i r e m e n t w h i c h i s s a t i s e d b y f e w , i f a n y , o f t h e c o m m e r c i a l D B M S s .

    4 S o m e i m p l e m e n t a t i o n a s p e c t s

    M n e s i a i s e n t i r e l y i m p l e m e n t e d i n E r l a n g . T h e E r l a n g p r o g r a m m i n g e n v i r o n m e n t

    h a s t u r n e d o u t t o b e t h e i d e a l v e h i c l e f o r t h e i m p l e m e n t a t i o n o f a d i s t r i b u t e d

    D B M S a n d t h e e n t i r e i m p l e m e n t a t i o n o f M n e s i a i n c l u d i n g a l l a s p e c t s o f t h e

    s y s t e m f r o m l o w l e v e l s t o r a g e m a n a g e m e n t t o t h e o p t i m i z i n g q u e r y c o m p i l e r i s

    s m a l l a n d c o n s i s t s o f n o t m o r e t h a n a p p r o x i m a t e l y 2 0 0 0 0 l i n e s o f E r l a n g c o d e .

    P e r s i s t e n t s t o r a g e i s i m p l e m e n t e d o n t o p o f t h e u n d e r l y i n g o p e r a t i n g s y s t e m

    l e s y s t e m . T h e d i s a d v a n t a g e o f t h i s i s p e r f o r m a n c e o f d i s c o p e r a t i o n s a n d t h e

    m a j o r a d v a n t a g e i s p o r t a b i l i t y . S i n c e M n e s i a i s p r i m a r i l y i n t e n d e d t o w o r k a s

    p r i m a r y m e m o r y D B M S , w e f e e l t h a t t h e p o r t a b i l i t y a s p e c t i s t h e m o r e i m p o r -

    t a n t . T a b l e s a n d i n d e x e s i n p r i m a r y m e m o r y a r e i m p l e m e n t e d a s l i n e a r h a s h

    l i s t s 1 3 a n d s e c o n d a r y s t o r a g e t a b l e s a r e i m p l e m e n t e d a s n a m e d l e s . E a c h

    l e i s o r g a n i z e d a s a l i n e a r h a s h l i s t w i t h a m e d i u m c h a i n l e n g t h o f t h e h a s h

    b u c k e t s e t t o a s m a l l v a l u e . T h e l i n e a r h a s h l i s t i s v e r y e c i e n t f o r l o o k u p o p -

    e r a t i o n s a n d r e a s o n a b l y e c i e n t f o r i n s e r t o p e r a t i o n s . F i l e s a n d t a b l e s c a n g r o w

    a n d s h r i n k d y n a m i c a l l y . S p a c e m a n a g e m e n t o n e a c h l e i s p e r f o r m e d t h r o u g h a

    b u d d y a l g o r i t h m .

    T h e M n e s i a l o c k m a n a g e r u s e s a m u l t i t u d e o f t r a d i t i o n a l t e c h n i q u e s . L o c k -

    i n g i s d y n a m i c , a n d e a c h l o c k i s a c q u i r e d b y a t r a n s a c t i o n w h e n n e e d e d . R e g u l a r

    t w o p h a s e l o c k i n g 6 i s u s e d a n d d e a d l o c k p r e v e n t i o n i s t r a d i t i o n a l w a i t d i e 1 4 .

    T h e t i m e s t a m p s f o r t h e w a i t d i e a l g o r i t h m a r e a c q u i r e d b y L a m p o r t c l o c k s 1 2

    m a i n t a i n e d b y t h e t r a n s a c t i o n m a n a g e r o n e a c h n o d e . W h e n a t r a n s a c t i o n i s

    r e s t a r t e d , i t s L a m p o r t c l o c k i s m a i n t a i n e d , t h u s m a k i n g M n e s i a l i v e l o c k f r e e a s

    w e l l . T h e l o c k m a n a g e r a l s o i m p l e m e n t s m u l t i g r a n u l a r i t y l o c k i n g 1 0 . T r a d i -

    t i o n a l t w o p h a s e c o m m i t 9 i s u s e d b y t h e t r a n s a c t i o n m a n a g e r w h e n a t r a n s a c -

    t i o n i s c o m m i t s .

  • 8/6/2019 Mnesia - A Dristibuted Robust DBMS for Telecommunications Applications

    12/15

    S i m p l e q u e r i e s a r e e v a l u a t e d b y t h e r e l a t i o n a l D B M S t e c h n i q u e o p e r a t o r s

    8 , w h e r e a s r e c u r s i v e q u e r i e s a r e e v a l u a t e d b y S L G 3 r e s o l u t i o n . S i n c e M n e s i a

    i s r u n n i n g o n t o p o f d i s t r i b u t e d E r l a n g t h e i m p l e m e n t a t i o n i s g r e a t l y s i m p l i -

    e d . I n a d i s t r i b u t e d a p p l i c a t i o n t h e r e a r e s e p a r a t e E r l a n g n o d e s r u n n i n g o n

    u s u a l l y d i e r e n t m a c h i n e s . E r l a n g t a k e s c a r e o f t h e c o m m u n i c a t i o n b e t w e e n

    p r o c e s s e s p o s s i b l y o n s e p a r a t e n o d e s t r a n s p a r e n t l y . D i s t r i b u t e d E r l a n g w o r k s

    a l s o t r a n s p a r e n t l y a c r o s s d i e r e n t c o m p u t e r s w i t h d i e r e n t e n d i a n i s m , t h u s a

    M n e s i a s y s t e m c a n c o n s i s t o f a s e t o f h e t e r o g e n o u s c o m p u t e r s y s t e m s . P r o c e s s e s

    a n d n o d e s c a n e a s i l y b e s t a r t e d , s u p e r v i s e d a n d s t o p p e d b y p r o c e s s e s o n o t h e r

    n o d e s . T h i s m a k e s m u c h o f c o m m u n i c a t i o n i m p l e m e n t a t i o n d i c u l t i e s d i s a p p e a r

    f o r M n e s i a a s w e l l a s f o r a p p l i c a t i o n s .

    5 P e r f o r m a n c e d i s c u s s i o n

    I n t h i s s e c t i o n w e p r o v i d e s o m e m e a s u r e m e n t s o n t h e M n e s i a s y s t e m . T h e g u r e s

    c l e a r l y i n d i c a t e t h a t :

    T h e c o s t o f u s i n g t h e t r a n s a c t i o n s y s t e m , a s o p p o s e d t o u s i n g t h e d i r t y

    i n t e r f a c e , i s s u b s t a n t i a l . W e b e l i e v e t h a t t h e c o r r e c t i n t e r p r e t a t i o n o f t h i s i s

    t h a t t h e d i r t y i n t e r f a c e i s f a s t a n d n o t t h a t t h e t r a n s a c t i o n s y s t e m i s s l o w .

    T h e c o s t o f r e p l i c a t i o n i s f a i r l y h i g h . T h i s i s e x p e c t e d s i n c e t h e c o m p u t e r s

    u s e d i n t h e t e s t a r e i n t e r c o n n e c t e d b y a n o r d i n a r y s h a r e d m e d i a 1 0 M b i t s e c

    E t h e r n e t .

    T h e c o m p u t e r s i n t h e t e s t a r e t h r e e S u n U l t r a S p a r c s r u n n i n g S o l a r i s 2 . 5 . A l l

    t r a n s a c t i o n s a r e i n i t a t e d f r o m t h e o n e U l t r a S p a r c a t 1 6 7 M h z a n d t h e o t h e r t w o

    m a c h i n e s r u n a t 1 4 3 M h z .

    n u m b e r o f r e p l i c a s 1 2 3

    d i v o r c e 1 1 8 7 7 5 0 0 9 1 3 3 7 2

    d i v o r c e 1 u s i n g w r e a d 1 2 2 5 4 7 0 3 1 2 1 8 5

    d i r t y d i v o r c e 1 1 8 1 5 9 2 1 1 2 1

    T a b l e 1 . W a l l c l o c k m i c r o s e c o n d s t o e x e c u t e d i v o r c e 1 w i t h d i e r e n t c o n g u r a t i o n s

    I n t h e r s t r o w , w e r u n t h e f u n c t i o n d i v o r c e 1 f r o m s e c t i o n 2 . I n t h e s e c o n d

    r o w w e r u n a v e r s i o n o f d i v o r c e u s i n g a M n e s i a f u n c t i o n w r e a d 1 i n s t e a d o f

    r e a d 1 . T h i s f u n c t i o n r e a d s t h e o b j e c t b u t s e t s a w r i t e l o c k i n s t e a d o f a r e a d

    l o c k . T h i s i s m o r e e c i e n t i f w e k n o w t h a t w e a r e g o i n g t o s u b s e q u e n t l y w r i t e

    t h e s a m e o b j e c t . T h i s w a y t h e l o c k n e e d n o t b e u p g r a d e d f r o m a r e a d l o c k t o

    a w r i t e l o c k . F i n a l l y i n t h e l a s t r o w w e u s e t h e d i r t y f u n c t i o n s t o r e a d a n d

    w r i t e t h e r e p l i c a t e d t a b l e s , t h u s b y p a s s i n g t h e t r a n s a c t i o n s y s t e m a n d u s i n g t h e

    l i g h t w e i g h t l o c k s .

  • 8/6/2019 Mnesia - A Dristibuted Robust DBMS for Telecommunications Applications

    13/15

    6 C o n c l u s i o n s

    T h e r e e x i s t s t o d a y a v e r y l a r g e n u m b e r o f D B M S s , a l a r g e n u m b e r o f c o m m e r -

    c i a l l y a v a i l a b l e s y s t e m s a s w e l l a s a n u n c o u n t a b l e n u m b e r o f r e s e a r c h s y s t e m s .

    I t c o u l d a p p e a r a s i f i t w o u l d b e a b e t t e r s o l u t i o n t o u s e a c o m m e r i c a l D B M S

    b u t i f a l l t h e a s p e c t s f r o m s e c t i o n 3 a r e t a k e n i n a c c o u n t , n o s u i t a b l e c o m m e r c i a l

    D B M S s e x i s t s . W e f e e l t h a t o u r m a i n c o n t r i b u t i o n s a r e t h e f o l l o w i n g .

    W e h a v e i m p l e m e n t e d a n e n t i r e d i s t r i b u t e d D B M S b y c o m b i n i n g a l a r g e

    n u m b e r o f w e l l k n o w n t e c h n i q u e s . M a n y r e s e a r c h g r o u p s c h o s e t o s t u d y s o m e

    a s p e c t s o f D B M S s o n l y , w e h a v e i m p l e m e n t e d a f u l l d i s t r i b u t e d D B M S . F e w

    s u c h i m p l e m e n t a t i o n s e x i s t .

    W e h a v e s h o w e d t h a t E r l a n g i s v e r y w e l l s u i t e d f o r n o t o n l y t e l e c o m m u n i c a -

    t i o n s s y s t e m b u t a l s o f o r t h e i m p l e m e n t a t i o n o f D B M S s y s t e m s l i k e M n e s i a .

    T o o u r k n o w l e d g e t h i s i s t h e r s t t i m e a d i s t r i b u t e d D B M S i s i m p l e m e n t e d

    i n a s y m b o l i c p r o g r a m m i n g l a n g u a g e .

    W e h a v e p r o v i d e d a D B M S s o l u t i o n t h a t a d d r e s s a l l , o r a t l e a s t m a n y , a s p e c t s

    o f d a t a m a n a g e m e n t i n t e l e c o m m u n i c a t i o n s s y s t e m s .

    T h e M n e s i a s y s t e m i s c u r r e n t l y b e i n g u s e d t o b u i l d r e a l p r o d u c t s i n E r i c s s o n

    t o d a y , t h u s i t i s n o l o n g e r a m e r e p r o t o t y p e s y s t e m , i t h a s m a t u r e d e n o u g h t o

    b e l a b e l e d a p r o d u c t . T h e s y s t e m i s a v a i l a b l e a t h t t p : w w w . e r i c s s o n . s e e r l a n g

    R e f e r e n c e s

    1 . A r m s t r o n g , J . L . , W i l l i a m s , M . C . , W i k s t r o m , C . a n d V i r d i n g , S . R . , C o n c u r r e n t

    P r o g r a m m i n g i n E r l a n g , 2 : n d e d . P r e n t i c e H a l l 1 9 9 5

    2 . B e r n s t e i n , P . A . , H a d z i l a c o s , V . , G o o d m a n , N . C o n c u r r e n c y C o n t r o l a n d r e c o v e r y i n

    D a t a b a s e S y s t e m s A d d i s o n W e s l e y , 1 9 8 7 .

    3 . C h e n , A . W . , W a r r e n , D . S . Q u e r y E v a l u a t i o n u n d e r t h e W e l l F o u n d e d S e m a n t i c s

    P r o c . A C M S I G A C T - S I G M O D - S I G A R T S y m p . o n P r i n c i p l e s o f D a t a b a s e S y s .

    W h a s h i n g t o n , 1 9 9 3 .

    4 . C a s e , K . M c C l o g h r i e , M . R o s e , S . W a l d b u s s e r . M a n a g e m e n t I n f o r m a t i o n B a s e f o r

    V e r s i o n 2 o f t h e S i m p l e N e t w o r k M a n a g e m e n t P r o t o c o l S N M P v 2 , J a n , 1 9 9 6 .

    5 . C o p e l a n d , G . , M a i e r , D . M a k i n g S m a l l t a l k a d a t a b a s e s y s t e m P r o c e e d i n g s o f t h e

    1 9 8 4 A C M S I G M O D I n t e r n a t i o n a l C o n f e r e n c e o n M a n a g e m e n t o f D a t a . p p . 3 1 6 3 2 5 .

    B o s t o n 1 9 8 4 .

    6 . E s w a r a n , K . P . , G r e y , J . N . , L o r i e , R . A . a n d T r a i g e r , I . L . T h e N o t i o n s o f C o n s i s t e n c e

    a n d P r e d i c a t e L o c k s i n a D a t a b a s e s y s t e m C o m m u n i c a t i o n s o f A C M , 1 9 1 1 : 6 2 4 6 3 3 ,

    N o v e m b e r 1 9 7 6 .

    7 . F a e h n d r i c h , M . , M o r r i s e t t , G . , N e t t l e s , S . , W i n g , J . E x t e n s i o n s t o S t a n d a r d M L t o

    S u p p o r t T r a n s a c t i o n s A C M S I G P L A N W o r k s h o p o n M L a n d i t s A p p l i c a t i o n s , J u n e

    2 0 2 1 , 1 9 9 2 .

    8 . G o e t z , G . Q u e r y E v a l u a t i o n T e c h n i q u e s f o r L a r g e D a t a b a s e s A C M C S 2 2 5 : 7 3 1 7 0 ,

    J u n e 1 9 9 3 .

    9 . G r e y , J . N . N o t e s o n D a t a b a s e o p e r a t i n g s y s t e m : A n a d v a n c e d c o u r s e L e c t u r e n o t e s

    i n C o m p u t e r S c i e n c e , S p r i n g e r V e r l a g , B e r l i n . 1 6 0 : 3 9 3 4 8 1 , 1 9 7 8 .

  • 8/6/2019 Mnesia - A Dristibuted Robust DBMS for Telecommunications Applications

    14/15

  • 8/6/2019 Mnesia - A Dristibuted Robust DBMS for Telecommunications Applications

    15/15

    S u b j e c t I n d e x