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

Age of the Micro Service - CodeSlice Aug 2014

Age of the Micro Service - CodeSlice Aug 2014

Presentation on Micro Services given at CodeSlice Aug 2014 hosted at the Kainos Software offices in Belfast

Chris Cundill

August 28, 2014
Tweet

More Decks by Chris Cundill

Other Decks in Programming

Transcript

  1. About  Me   Chris  Cundill     Java  &  Scala

     dev  with  team  lead   experience.    Worked  on  exci.ng  high-­‐scale   projects  with  Interna.onal  Baccalaureate,   Friends  Life  Insurance  and  Money   Supermarket.     Recently  maintained  popular   #ThisWeekInScala  community  blog  for   over  a  year.  
  2. Contents   •  Theory:  Micro  services   •  New  age

     Java   •  Dropwizard   •  Exercise  with  Dropwizard  
  3. Theory:  Micro  services     Mar.n  Fowler   “…  a

     par.cular  way  of  designing   soSware  applica.ons  as  suites  of   independently  deployable  services”     A  Microservice  is  a  discrete,  isolated,  and   named  piece  of  logic  that  consumes  0…N  inputs   and  produces  0…N  outputs  and  which  is   executed  for  the  benefit  of  an  invoker—it  is   performed  as  a  service.   Victor  Klang   hZp://mar.nfowler.com/ar.cles/microservices.html   hZp://klangism.tumblr.com/post/80087171446/microservices  
  4. Theory:  Microservices   •  Architectural  Style   –  Building  apps

     as  suite  of  services   –  Componen.za.on  via  Services   •  Klang  says  Microservices  are:   –  Discrete   •  Small  number  of  responsibili.es   –  Isolated   •  Provisioned  separately   –  Named   •  Unique  signature/iden.fier   –  Defined   •  Input  and  output  defined  and  documented  
  5. Theory:  Microservices   •  Pros   –  Maintain  small  chunks

      –  Scale  separately   –  Re-­‐usable  services   –  Technology  freedom   •  Best  tech  for  the  job   •  Cons   –  More  provisioning  for  Ops!   –  Distributed  System  Complexity   –  Increased  network  latency  
  6. Theory:  Microservices   •  RESTful   – All  the  methods  you

     need…   •  GET,  POST,  PUT,  DELETE   – All  the  status  codes  you  need…   •  200,  201,  400,  401,  402,  404,  500   – …and  don’t  need   •  418  I'm  a  teapot   –  hZp://en.wikipedia.org/wiki/Representa.onal_state_transfer   –  hZp://hZpstatus.es/  
  7. “organiza.ons  which   design  systems  ...  are   constrained  to

     produce   designs  which  are  copies   of  the  communica.on   structures  of  these   organiza.ons”   hZp://en.wikipedia.org/wiki/Conway's_law   -­‐  Melvin  Conway  
  8. Dropwizard   •  Stable,  mature  libraries  from  the  Java  

    ecosystem   •  Simple,  light-­‐weight  package   •  Produc.on-­‐ready   – sophis.cated  configura.on,  applica.on  metrics,   health  checks,  logging  (with  archiving),   opera.onal  tools  &  more    
  9. “Programming  is   the  art  of  telling   another  human

      what  one  wants  the   computer  to  do.”   hZp://en.wikipedia.org/wiki/The_Art_of_Computer_Programming   -­‐  Donald  Knuth    
  10. Hands  on  exercise   •  Hello  hackers!   •  15

     mins   •  Build  from  scratch!   •  github.com/cpcundill/dvla-­‐hackathon-­‐ex1