hypermedia-driven orchestration in microservices
TRANSCRIPT
Hypermedia-DrivenOrchestrationinMicroservices
IrakliNadareishvili
DevOps:APIManagementandApplicationDevelopment
CATechnologiesDirectorofStrategy,APIAcademySessionDO3T25T
@inadarei#CAWorld
2 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD
©2015CA.Allrightsreserved.Alltrademarksreferencedhereinbelongtotheirrespectivecompanies.
Thecontentprovidedinthis CAWorld2015presentationisintendedforinformationalpurposesonlyanddoesnotformanytypeofwarranty. The informationprovidedbyaCApartnerand/orCAcustomerhasnotbeenreviewedforaccuracybyCA.
ForInformationalPurposesOnlyTermsofthisPresentation
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
4 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD
ArchitecturalStylesandtheDesignofNetwork-based Software,2001- RoyT.Fielding
“Hypermediaisdefinedbythepresenceofapplicationcontrolinformationembeddedwithin,orasalayer
above,thepresentationofinformation”
HypermediaperFielding
5 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD
LetAPIserverdynamicallyguideaclientbyrespondingtoclientwithnotjuststatic databutalsocontrolsdescribingAPIaffordances.
Or:Response=Data+Controls
6 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD
Mostcommonhypermediacontrolsfacilitate:“single,nextstep.”
HypermediaShortcoming?
Howdoweorchestrateloosely-coupledmicroservices
forcomplexworkflows?
8 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD
Examples:
E-COMMERCE
BOOKINGTRAVEL1
2
9 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD
BookingTravel
10 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD
Saga:Long-LivedCompensatingTransactions
SagawasintroducedbyHectorGarcia-MolinaandKennethSalemin1987.
ExamplescenariobyClemensVasters:http://vasters.com/clemensv/2012/09/01/Sagas.aspx
Car Hotel Flight
RoutingSlip
11 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD
@see:http://rels.messages.io
LinkRelationsforSaga:
§ rel =“routing-slip”(microformats)
§ rel =“compensatingtx”(microformats)
12 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD
E-Commerce
13 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD
3TypesofComplexWorkflows
BROWSING/DISCOVERY—“HYPERMEDIAMAZE”(AMUNDSEN)
CHECKOUT—SERVICE ORCHESTRATION
POST-PURCHASE—SERVICECHOREOGRAPHY
1
2
3
14 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD
Source:Richardson, Amundsen,Ruby, “RESTfulWebAPIs,”O’Reilly, 2013.
MazeProblems
– MikeAmundsen
“Problemistoocomplextobeunderstoodallatonce,soit’ssplitupintosteps.”
15 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD
Maze+XML
Source:Richardson, Amundsen,Ruby, “RESTfulWebAPIs,”O’Reilly, 2013.
16 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD
Checkout
1.CollectShipping Info 2.BillingInfo 3.AuthorizePayment
4.Post-PurchaseProcessing
Checkout:Orchestration
17 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD
OrchestrationforWizard-StyleWFs:
StandardIANAlinkrelations:
§ rel =“next”
§ rel =“prev”
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
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
20 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD
TypesofComplexWorkflows
BROWSING/DISCOVERY—“HYPERMEDIAMAZE”(MIKEAMUNDSEN)
CHECKOUT—SERVICEORCHESTRATION
POST-PURCHASE—SERVICECHOREOGRAPHY
1
2
3
DISTRIBUTEDTRANSACTIONS—SAGA4
Aretheremoreworkflowtypes?Probably,but:nexttime!
22 ©2015CA.ALLRIGHTSRESERVED.@CAWORLD #CAWORLD
Q&A