Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Monoliths must die!

Monoliths must die!

GOTO Amsterdam 2016

Avatar for Paulo Lopes

Paulo Lopes

June 14, 2016
Tweet

More Decks by Paulo Lopes

Other Decks in Programming

Transcript

  1. MONOLITHS MUST DIE! A VERT.X TALE ON REACTIVE MICROSERVICES by

    / RedHat Principal So ware Engineer Paulo Lopes @jetdrone
  2. MSA KILLER APP The services are easy to replace Services

    are organized around capabilities Services can be polyglot Architectures are symmetrical rather than hierarchical
  3. TOOLKIT < d e p e n d e n

    c y > < g r o u p i d > i o . v e r t x < / g r o u p i d > < a r t i f a c t i d > c o r e < / a r t i f a c t i d > < v e r s i o n > 3 . 2 . 1 < / v e r s i o n > < / d e p e n d e n c y >
  4. UNOPINIONATED i m p o r t i o .

    v e r t x . c o r e . A b s t r a c t V e r t i c l e ; p u b l i c c l a s s S e r v e r e x t e n d s A b s t r a c t V e r t i c l e { p u b l i c v o i d s t a r t ( ) { v e r t x . c r e a t e H t t p S e r v e r ( ) . r e q u e s t H a n d l e r ( r e q ­ > { r e q . r e s p o n s e ( ) . p u t H e a d e r ( " c o n t e n t ­ t y p e " , " t e x t / p l a i n " ) . e n d ( " H e l l o f r o m V e r t . x ! " ) ; } ) . l i s t e n ( 8 0 8 0 ) ; } }
  5. REACTIVE c o n n . q u e r

    y ( " S E L E C T * f r o m E M P " , r e s ­ > { i f ( r e s . s u c c e e d e d ( ) ) { R e s u l t S e t r e s u l t S e t = r e s . r e s u l t ( ) ; } e l s e { / / F a i l e d ! } } ) ;
  6. POLYGLOT v e r t x . c r e

    a t e H t t p S e r v e r ( ) . r e q u e s t H a n d l e r ( f u n c t i o n ( r e q ) { r e q . r e s p o n s e ( ) . p u t H e a d e r ( " c o n t e n t ­ t y p e " , " t e x t / p l a i n " ) . e n d ( " H e l l o f r o m J S V e r t . x ! " ) } ) . l i s t e n ( 8 0 8 0 )
  7. DISTRIBUTED E v e n t B u s e

    b = v e r t x . e v e n t B u s ( ) ; e b . c o n s u m e r ( " n e w s . s p o r t " , m e s s a g e ­ > { p r i n t l n ( " I h a v e r e c e i v e d a m e s s a g e : " + m e s s a g e . b o d y ( ) ) ; } ) ;
  8. MONOLITHS MORTAL WEAKNESS Message driven problem domain HTML5 and Realtime/Websocket

    problem Address services running on browsers Flexible actor model Scale out Mixed async and blocking code