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.

Irakli Nadareishvili

March 18, 2015
Tweet

More Decks by Irakli Nadareishvili

Other Decks in Technology

Transcript

  1. 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.”
  2. 10   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Irakli

     Nadareishvili  –  @inadarei   Hypermedia-­‐Driven   Orchestra3on  in  Microservices  
  3. 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.  ”  
  4. 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  
  5. 18   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Unbundling:

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

    Architecture is complex Uncomfortable truth:
  7. 22   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Most

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

     DESIGN   Characteristics of a Microservice Architecture per Fowler: DECENTRALIZED  GOVERNANCE  &  DATA  MANAGEMENT   5   7  
  9. 27   ©  2015  CA.  ALL  RIGHTS  RESERVED.   We

    can build loosely-coupled, evolvable services, by designing them as Hypermedia APIs Solution we know works:
  10. 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”  
  11. 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.  
  12. 30   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Challenge

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

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

      BOOKING  TRAVEL   1   2   Examples:
  15. 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
  16. 35   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Link

    Relations for Saga: •  rel  =  “rouTng-­‐slip”  (new:  microformats)   •  rel  =  “compensaTngtx”  (new:  microformats)   @see:  hPp://rels.messages.io  
  17. 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
  18. 40   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Checkout:

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

    for Wizard-Style WFs: •  rel  =  “next”   •  rel  =  “prev”   Standard  IANA  link  relaTons:  
  20. 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»
  21. 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  
  22. 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  
  23. 45   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Are

    there more workflow types? Probably, but: next time!
  24. 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  
  25. Director  of  Strategy,  API  Academy         Irakli

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