hypermedia-driven orchestration in microservices

22
Hypermedia-Driven Orchestration in Microservices Irakli Nadareishvili DevOps : API Management and Application Development CA Technologies Director of Strategy, API Academy Session DO3T25T @inadarei #CAWorld

Upload: ca-technologies

Post on 14-Apr-2017

401 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Hypermedia-Driven Orchestration in Microservices

Hypermedia-DrivenOrchestrationinMicroservices

IrakliNadareishvili

DevOps:APIManagementandApplicationDevelopment

CATechnologiesDirectorofStrategy,APIAcademySessionDO3T25T

@inadarei#CAWorld

Page 2: Hypermedia-Driven Orchestration in Microservices

2 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

©2015CA.Allrightsreserved.Alltrademarksreferencedhereinbelongtotheirrespectivecompanies.

Thecontentprovidedinthis CAWorld2015presentationisintendedforinformationalpurposesonlyanddoesnotformanytypeofwarranty. The informationprovidedbyaCApartnerand/orCAcustomerhasnotbeenreviewedforaccuracybyCA.

ForInformationalPurposesOnlyTermsofthisPresentation

Page 3: Hypermedia-Driven Orchestration in Microservices

3 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

Abstract

Hypermedia-DrivenOrchestrationinMicroservicesThenotionof"affordances"hasplayedseminalroleintransformingourunderstandingofusableservicedesign.Itiskeyinhypermediaarchitecturalstyleandenablesustobuildresilientsystems“atthescaleofdecades”.Withthemicroservice architecturalstyle,wecanbuildsystemsthathavehigherdegreesoffreedomthanthosehavingmonolitharchitectures.Insuchsystems,effectiveorchestrationandchoreographyarecrucial.Duringthispresentation, IrakliNadareishvili,DirectorofAPIStrategy,APIAcademy,exploreshypermedia-enabledapproachthatleadsto loosely-coupled,evolvableservicedesign.

IrakliNadareishviliCATechnologiesDirectorofStrategy,APIAcademy

Page 4: Hypermedia-Driven Orchestration in Microservices

4 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

ArchitecturalStylesandtheDesignofNetwork-based Software,2001- RoyT.Fielding

“Hypermediaisdefinedbythepresenceofapplicationcontrolinformationembeddedwithin,orasalayer

above,thepresentationofinformation”

HypermediaperFielding

Page 5: Hypermedia-Driven Orchestration in Microservices

5 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

LetAPIserverdynamicallyguideaclientbyrespondingtoclientwithnotjuststatic databutalsocontrolsdescribingAPIaffordances.

Or:Response=Data+Controls

Page 6: Hypermedia-Driven Orchestration in Microservices

6 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

Mostcommonhypermediacontrolsfacilitate:“single,nextstep.”

HypermediaShortcoming?

Page 7: Hypermedia-Driven Orchestration in Microservices

Howdoweorchestrateloosely-coupledmicroservices

forcomplexworkflows?

Page 8: Hypermedia-Driven Orchestration in Microservices

8 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

Examples:

E-COMMERCE

BOOKINGTRAVEL1

2

Page 9: Hypermedia-Driven Orchestration in Microservices

9 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

BookingTravel

Page 10: Hypermedia-Driven Orchestration in Microservices

10 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

Saga:Long-LivedCompensatingTransactions

SagawasintroducedbyHectorGarcia-MolinaandKennethSalemin1987.

ExamplescenariobyClemensVasters:http://vasters.com/clemensv/2012/09/01/Sagas.aspx

Car Hotel Flight

RoutingSlip

Page 11: Hypermedia-Driven Orchestration in Microservices

11 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

@see:http://rels.messages.io

LinkRelationsforSaga:

§ rel =“routing-slip”(microformats)

§ rel =“compensatingtx”(microformats)

Page 12: Hypermedia-Driven Orchestration in Microservices

12 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

E-Commerce

Page 13: Hypermedia-Driven Orchestration in Microservices

13 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

3TypesofComplexWorkflows

BROWSING/DISCOVERY—“HYPERMEDIAMAZE”(AMUNDSEN)

CHECKOUT—SERVICE ORCHESTRATION

POST-PURCHASE—SERVICECHOREOGRAPHY

1

2

3

Page 14: Hypermedia-Driven Orchestration in Microservices

14 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

Source:Richardson, Amundsen,Ruby, “RESTfulWebAPIs,”O’Reilly, 2013.

MazeProblems

– MikeAmundsen

“Problemistoocomplextobeunderstoodallatonce,soit’ssplitupintosteps.”

Page 15: Hypermedia-Driven Orchestration in Microservices

15 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

Maze+XML

Source:Richardson, Amundsen,Ruby, “RESTfulWebAPIs,”O’Reilly, 2013.

Page 16: Hypermedia-Driven Orchestration in Microservices

16 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

Checkout

1.CollectShipping Info 2.BillingInfo 3.AuthorizePayment

4.Post-PurchaseProcessing

Checkout:Orchestration

Page 17: Hypermedia-Driven Orchestration in Microservices

17 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

OrchestrationforWizard-StyleWFs:

StandardIANAlinkrelations:

§ rel =“next”

§ rel =“prev”

Page 18: Hypermedia-Driven Orchestration in Microservices

18 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

Post-Purchaseservice

Shipping Service

E-mailNotificationService

SMS NotificationService

PurchaseCompleted

event

PushNotificationService

Inspiredbyachoreographyexamplein:SamNewman,BuildingMicroservices,O’Reilly,2015.

«subscribes to»

PostPurchase:Choreography

Page 19: Hypermedia-Driven Orchestration in Microservices

19 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

@see:http://rels.messages.io

ServiceChoreography

§ rel =“hub”(IANAstandard)§ rel =“sub”(new:microformats)§ rel =“unsub”(new:microformats)§ rel =“events”(new:microformats)

Async andevent-driven.Standard:Pubsubhubbub

Page 20: Hypermedia-Driven Orchestration in Microservices

20 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

TypesofComplexWorkflows

BROWSING/DISCOVERY—“HYPERMEDIAMAZE”(MIKEAMUNDSEN)

CHECKOUT—SERVICEORCHESTRATION

POST-PURCHASE—SERVICECHOREOGRAPHY

1

2

3

DISTRIBUTEDTRANSACTIONS—SAGA4

Page 21: Hypermedia-Driven Orchestration in Microservices

Aretheremoreworkflowtypes?Probably,but:nexttime!

Page 22: Hypermedia-Driven Orchestration in Microservices

22 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD

Q&A