Slide 1

Slide 1 text

Hypermedia-­‐Driven   Orchestra3on  in  Microservices   Irakli  Nadareishvili  -­‐  @inadarei   Director  of  Strategy,  API  Academy     March,  2015  

Slide 2

Slide 2 text

2   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Marc Andreessen

Slide 3

Slide 3 text

3   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Marc Andreessen

Slide 4

Slide 4 text

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.”

Slide 5

Slide 5 text

5   ©  2015  CA.  ALL  RIGHTS  RESERVED.   “Unbundling”

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

11   ©  2015  CA.  ALL  RIGHTS  RESERVED.   What are “Microservices ”?

Slide 12

Slide 12 text

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.  ”  

Slide 13

Slide 13 text

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  

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

16   ©  2015  CA.  ALL  RIGHTS  RESERVED.  

Slide 17

Slide 17 text

17   ©  2015  CA.  ALL  RIGHTS  RESERVED.   It is not just about technology

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

19   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Microservice Architecture is complex Uncomfortable truth:

Slide 20

Slide 20 text

20   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Monolith is brittle, but has order

Slide 21

Slide 21 text

21   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Microservices: High Degree of Freedom

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

23   ©  2015  CA.  ALL  RIGHTS  RESERVED.  

Slide 24

Slide 24 text

24   ©  2015  CA.  ALL  RIGHTS  RESERVED.  

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

26   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Watch-out for tight coupling!

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

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”  

Slide 29

Slide 29 text

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.  

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

31   ©  2015  CA.  ALL  RIGHTS  RESERVED.   How do we orchestrate Loosely-coupled microservices for complex workflows?

Slide 32

Slide 32 text

32   ©  2015  CA.  ALL  RIGHTS  RESERVED.   E-­‐COMMERCE   BOOKING  TRAVEL   1   2   Examples:

Slide 33

Slide 33 text

33   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Booking Travel

Slide 34

Slide 34 text

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

Slide 35

Slide 35 text

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

Slide 36

Slide 36 text

36   ©  2015  CA.  ALL  RIGHTS  RESERVED.   E-Commerce

Slide 37

Slide 37 text

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

Slide 38

Slide 38 text

38   ©  2015  CA.  ALL  RIGHTS  RESERVED.   Maze Problems

Slide 39

Slide 39 text

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

Slide 40

Slide 40 text

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

Slide 41

Slide 41 text

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

Slide 42

Slide 42 text

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»

Slide 43

Slide 43 text

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  

Slide 44

Slide 44 text

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  

Slide 45

Slide 45 text

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

Slide 46

Slide 46 text

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  

Slide 47

Slide 47 text

Director  of  Strategy,  API  Academy         Irakli  Nadareishvili     @inadarei  @apiacademy  @cainc   Slideshare.net/cainc   linkedin.com/company/ca-­‐technologies   ca.com