Date post: | 14-Jul-2015 |
Category: |
Technology |
Upload: | irakli-nadareishvili |
View: | 853 times |
Download: | 1 times |
Hypermedia*DrivenOrchestration4in4Microservices
Irakli4Nadareishvili * @inadareiDirector(of(Strategy,(API(Academy
March,42015
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.”#
10 ©(2015(CA.(ALL(RIGHTS(RESERVED.
Irakli(Nadareishvili –@inadarei
Hypermedia*DrivenOrchestration4in4Microservices
12 ©(2015(CA.(ALL(RIGHTS(RESERVED.
Martin Fowler:
O http://martinfowler.com/articles/microservices.html
“We(cannot(say(there(is(a(formal(
definition(of(the(microservices
architectural(style,(but(we(can(attempt(
to(describe(what(we(see(as(common(
characteristics(for(architectures(that(fit(
the(label.(�
13 ©(2015(CA.(ALL(RIGHTS(RESERVED.
EVOLUTIONARY4DESIGN
Characteristics of a Microservice Architecture per Fowler:COMPONENTIZATION4VIA4SERVICES
ORGANIZED4AROUND4BUSINESS4CAPABILITIES
PRODUCTS,4NOT44PROJECTS
SMART4ENDPOINTS4AND4DUMB4PIPES
DECENTRALIZED4GOVERNANCE4&4DATA4MANAGEMENT
1
2
3
4
5
INFRASTRUCTURE4AUTOMATION/DESIGN4FOR4FAILURE6
7
18 ©(2015(CA.(ALL(RIGHTS(RESERVED.
Unbundling: greatest disruptor of tech industry
“Microservices unbundle'your%business%for%internal%and%[controlled]%external%
disruption”#
– Irakli#Nadareishvili
22 ©(2015(CA.(ALL(RIGHTS(RESERVED.
Most of us are quite awful at designing distributed systems.
Uncomfortable truth:
24 ©(2015(CA.(ALL(RIGHTS(RESERVED.
EVOLUTIONARY4DESIGN
Characteristics of a Microservice Architecture per Fowler:
DECENTRALIZED4GOVERNANCE4&4DATA4MANAGEMENT5
7
26 ©(2015(CA.(ALL(RIGHTS(RESERVED.
We can build loosely-coupled, evolvable services, by designing
them as Hypermedia APIs
Solution we know works:
27 ©(2015(CA.(ALL(RIGHTS(RESERVED.
Hypermedia per Fielding
Architectural(Styles(and(the(Design(of(NetworkObased(
Software,(2001
O Roy(T.(Fielding
“Hypermedia(is(defined(by(the(
presence(of(application(control(
information(embedded(within,(or(
as(a(layer(above,(the(presentation(
of(information�
28 ©(2015(CA.(ALL(RIGHTS(RESERVED.
Or: response = data + controls
API(server(would(have(to(send(client(
not(just(static data,(but(also(controls(describing(API(affordances.
29 ©(2015(CA.(ALL(RIGHTS(RESERVED.
Challenge by Ioseb Dzmanashvili:Most(common(hypermedia(
controls(facilitate(“a(single(step”.
30 ©(2015(CA.(ALL(RIGHTS(RESERVED.
How do we orchestrate Loosely-coupled microservices
for complex workflows?
31 ©(2015(CA.(ALL(RIGHTS(RESERVED.
#REM: response = data + controls
API(server(would(have(to(send(client(
not(just(static data,(but(also(controls(describing(API(affordances.
32 ©(2015(CA.(ALL(RIGHTS(RESERVED.
Affordances
Theory(of(Affordances,(1979
O James(J.(Gibson
Affordances(are(all("action(possibilities"(
latent(in(the(environment.
35 ©(2015(CA.(ALL(RIGHTS(RESERVED.
Affordances’re key to a good designImagine(a(car(or(a(building(that(you(couldn't(possibly(
use,(unless(you(had(a(manual.(That(sounds(silly,(we(
don't(build(cars(or(buildings(like(that.(Yet,(that(is(
exactly(how(we(build(APIs(today.
37 ©(2015(CA.(ALL(RIGHTS(RESERVED.
Commonality Makes Affordances ObviousAre(all(cars(exactly(the(same?(No.(Can(we(do(basic(things(
with(any(car,(once(we(understand(how(cars(in(general(work?(
Yes!(Do(we(need(to(read(a(manual(for(that?(No!
41 ©(2015(CA.(ALL(RIGHTS(RESERVED.
Diagram(by:(Clemens(Vasters
source:(http://vasters.com/clemensv/2012/09/01/Sagas.aspx
Saga: Long-Lived Compensating Transactions
42 ©(2015(CA.(ALL(RIGHTS(RESERVED.
Link Relations for Saga:
• rel =(“routingOslip”((new:(microformats)
• rel =(“compensatingtx”((new:(microformats)
@see:(http://rels.messages.io
44 ©(2015(CA.(ALL(RIGHTS(RESERVED.
BROWSING/DISCOVERY4– “HYPERMEDIA4MAZE”4(AMUNDSEN)
CHECKOUT4– SERVICE4ORCHESTRATION
POST*PURCHASE4– SERVICE4CHOREOGRAPHY
1
2
3
3 Types of Complex Workflows
47 ©(2015(CA.(ALL(RIGHTS(RESERVED.
Checkout: Orchestration
Checkout
1.(Collect(Shipping(Info 2.(Billing(Info 3.(Authorize(Payment
4.(PostOpurchase(processing
48 ©(2015(CA.(ALL(RIGHTS(RESERVED.
Orchestration for Wizard-Style WFs:
• rel =(“next”
• rel =(“prev”
Standard(IANA(link(relations:
49 ©(2015(CA.(ALL(RIGHTS(RESERVED.
Post Purchase: Choreography
PostOPurchase(
service
Shipping(Service
EOmail(notification(service
SMSNotification(Service
Purchase(
Completed(event
Push(Notification(Service
«subscribes#to»
50 ©(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(eventOdriven.(
Standard:(Pubsubhubbub
@see:(http://rels.messages.io
51 ©(2015(CA.(ALL(RIGHTS(RESERVED.
BROWSING/DISCOVERY4– “HYPERMEDIA4MAZE”4(MIKE4AMUNDSEN)
CHECKOUT4– SERVICE4ORCHESTRATION
POST*PURCHASE4– SERVICE4CHOREOGRAPHY
1
2
3
Types of Complex Workflows
DISTRIBUTED4TRANSACTIONS4– SAGA4(HECTOR4GARCIA*MOLINA4&4KENNETH4SALEM4)4
53 ©(2015(CA.(ALL(RIGHTS(RESERVED.
Microservices❤ Hypermedia-Driven Orchestration
Photo( credit:(Corey( Seeman,( CC(BYONCOSA( 2.0.(https://www.flickr.com/photos/cseeman/14144834659