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

Hypermedia-Driven Orchestration in Microservices

Hypermedia-Driven Orchestration in Microservices

Presented at; O'Reilly Software Architecture Conference, Boston, 2015.

The notion of Affordances has played seminal role in transforming our understanding of usable service design. It is key in Hypermedia architectural style and enables us to build resilient systems “at the scale of decades”.

With Microservice architectural style we end-up building systems that have higher degrees of freedom than those having monolith architectures. In such systems, effective orchestration and choreography are crucial. In this talk we explore hypermedia-enabled approach that leads to loosely-coupled, evolvable service design.

0f78a2450647a9aa5bffd92b67074049?s=128

Irakli Nadareishvili

March 18, 2015
Tweet

Transcript

  1. Hypermedia-­‐Driven   Orchestra3on  in  Microservices   Irakli  Nadareishvili  -­‐  @inadarei

      Director  of  Strategy,  API  Academy     March,  2015  
  2. 2   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Marc

    Andreessen
  3. 3   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Marc

    Andreessen
  4. 4   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Marc

    Andreessen “This is a pattern that we love to fund: unbundle X from Y, but then use the liberation of X as leverage to do amazing new things with X.”
  5. 5   ©  2015  CA.  ALL  RIGHTS  RESERVED.   “Unbundling”

  6. 6   ©  2015  CA.  ALL  RIGHTS  RESERVED.   «unbundled

    by»
  7. 7   ©  2015  CA.  ALL  RIGHTS  RESERVED.   «unbundled

    by»
  8. 8   ©  2015  CA.  ALL  RIGHTS  RESERVED.   «unbundled

    by»
  9. 9   ©  2015  CA.  ALL  RIGHTS  RESERVED.   «unbundled

    by»
  10. 10   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Irakli

     Nadareishvili  –  @inadarei   Hypermedia-­‐Driven   Orchestra3on  in  Microservices  
  11. 11   ©  2015  CA.  ALL  RIGHTS  RESERVED.   What

    are “Microservices ”?
  12. 12   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Martin

    Fowler: -­‐  hPp://marTnfowler.com/arTcles/microservices.html   “We  cannot  say  there  is  a  formal   definiTon  of  the  microservices   architectural  style,  but  we  can  aPempt   to  describe  what  we  see  as  common   characterisTcs  for  architectures  that  fit   the  label.  ”  
  13. 13   ©  2015  CA.  ALL  RIGHTS  RESERVED.   EVOLUTIONARY

     DESIGN   Characteristics of a Microservice Architecture per Fowler: COMPONENTIZATION  VIA  SERVICES   ORGANIZED  AROUND  BUSINESS  CAPABILITIES   PRODUCTS,  NOT    PROJECTS   SMART  ENDPOINTS  AND  DUMB  PIPES   DECENTRALIZED  GOVERNANCE  &  DATA  MANAGEMENT   1   2   3   4   5   INFRASTRUCTURE  AUTOMATION/DESIGN  FOR  FAILURE   6   7  
  14. 14   ©  2015  CA.  ALL  RIGHTS  RESERVED.   We

    Know What It Is Not: Monolith
  15. 15   ©  2015  CA.  ALL  RIGHTS  RESERVED.   We

    Know It Is Popular:
  16. 16   ©  2015  CA.  ALL  RIGHTS  RESERVED.  

  17. 17   ©  2015  CA.  ALL  RIGHTS  RESERVED.   It

    is not just about technology
  18. 18   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Unbundling:

    greatest disruptor of tech industry “Microservices unbundle your business for internal and [controlled] external disruption” – Irakli Nadareishvili
  19. 19   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Microservice

    Architecture is complex Uncomfortable truth:
  20. 20   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Monolith

    is brittle, but has order
  21. 21   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Microservices:

    High Degree of Freedom
  22. 22   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Most

    of us are quite awful at designing distributed systems. Uncomfortable truth:
  23. 23   ©  2015  CA.  ALL  RIGHTS  RESERVED.  

  24. 24   ©  2015  CA.  ALL  RIGHTS  RESERVED.  

  25. 25   ©  2015  CA.  ALL  RIGHTS  RESERVED.   EVOLUTIONARY

     DESIGN   Characteristics of a Microservice Architecture per Fowler: DECENTRALIZED  GOVERNANCE  &  DATA  MANAGEMENT   5   7  
  26. 26   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Watch-out

    for tight coupling!
  27. 27   ©  2015  CA.  ALL  RIGHTS  RESERVED.   We

    can build loosely-coupled, evolvable services, by designing them as Hypermedia APIs Solution we know works:
  28. 28   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Hypermedia

    per Fielding Architectural  Styles  and  the  Design  of  Network-­‐based   So\ware,  2001   -­‐  Roy  T.  Fielding   “Hypermedia  is  defined  by  the   presence  of  applicaTon  control   informaTon  embedded  within,  or     as  a  layer  above,  the  presentaTon     of  informaTon”  
  29. 29   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Or:

    response = data + controls API  server  would  have  to  send  client   not  just  sta$c  data,  but  also  controls   describing  API  affordances.  
  30. 30   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Challenge

    by Ioseb Dzmanashvili: Most  common  hypermedia   controls  facilitate  “a  single  step”.  
  31. 31   ©  2015  CA.  ALL  RIGHTS  RESERVED.   How

    do we orchestrate Loosely-coupled microservices for complex workflows?
  32. 32   ©  2015  CA.  ALL  RIGHTS  RESERVED.   E-­‐COMMERCE

      BOOKING  TRAVEL   1   2   Examples:
  33. 33   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Booking

    Travel
  34. 34   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Diagram

     by:  Clemens  Vasters     source:  hPp://vasters.com/clemensv/2012/09/01/Sagas.aspx     Saga: Long-Lived Compensating Transactions
  35. 35   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Link

    Relations for Saga: •  rel  =  “rouTng-­‐slip”  (new:  microformats)   •  rel  =  “compensaTngtx”  (new:  microformats)   @see:  hPp://rels.messages.io  
  36. 36   ©  2015  CA.  ALL  RIGHTS  RESERVED.   E-Commerce

  37. 37   ©  2015  CA.  ALL  RIGHTS  RESERVED.   BROWSING/DISCOVERY

     –  “HYPERMEDIA  MAZE”  (AMUNDSEN)   CHECKOUT  –  SERVICE  ORCHESTRATION   POST-­‐PURCHASE  –  SERVICE  CHOREOGRAPHY   1   2   3   3 Types of Complex Workflows
  38. 38   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Maze

    Problems
  39. 39   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Maze+XML

  40. 40   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Checkout:

    Orchestration Checkout   1.  Collect  Shipping  Info   2.  Billing  Info   3.  Authorize  Payment   4.  Post-­‐purchase  processing  
  41. 41   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Orchestration

    for Wizard-Style WFs: •  rel  =  “next”   •  rel  =  “prev”   Standard  IANA  link  relaTons:  
  42. 42   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Post

    Purchase: Choreography Post-­‐Purchase   service   Shipping  Service   E-­‐mail  noTficaTon  service   SMS  NoTficaTon  Service   Purchase   Completed   event   Push  NoTficaTon  Service   «subscribes to»
  43. 43   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Service

    Choreography •  rel  =  “hub”  (IANA  standard)   •  rel  =  “sub”  (new:  microformats)   •  rel  =  “unsub”  (new:  microformats)   •  rel  =  “events”  (new:  microformats)   Async  and  event-­‐driven.     Standard:  Pubsubhubbub   @see:  hPp://rels.messages.io  
  44. 44   ©  2015  CA.  ALL  RIGHTS  RESERVED.   BROWSING/DISCOVERY

     –  “HYPERMEDIA  MAZE”  (MIKE  AMUNDSEN)   CHECKOUT  –  SERVICE  ORCHESTRATION   POST-­‐PURCHASE  –  SERVICE  CHOREOGRAPHY   1   2   3   Types of Complex Workflows DISTRIBUTED  TRANSACTIONS  –  SAGA  (HECTOR  GARCIA-­‐MOLINA  &  KENNETH  SALEM  )   4  
  45. 45   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Are

    there more workflow types? Probably, but: next time!
  46. 46   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Microservices

    ❤ Hypermedia-Driven Orchestration Photo  credit:  Corey  Seeman,  CC  BY-­‐NC-­‐SA  2.0.  hPps://www.flickr.com/photos/cseeman/14144834659  
  47. Director  of  Strategy,  API  Academy         Irakli

     Nadareishvili     @inadarei  @apiacademy  @cainc   Slideshare.net/cainc   linkedin.com/company/ca-­‐technologies   ca.com