comparing service-based architectures

97
Comparing Service- based Architectures @neal4d nealford.com 1

Upload: vubao

Post on 12-Feb-2017

234 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Comparing Service-based Architectures

Comparing Service-based Architectures

@neal4d nealford.com

1

Page 2: Comparing Service-based Architectures

agenda

Micro Service-oriented

Service-based

2

Page 3: Comparing Service-based Architectures

Service-oriented Architecture

3

Page 4: Comparing Service-based Architectures

System A

System B

System C

origins: hubs

4

Page 5: Comparing Service-based Architectures

System D (ftp only)

System A

System B

System C

origins: hubs

5

Page 6: Comparing Service-based Architectures

System D (ftp only)

System A

System B

System C

System E (http only)

origins: hubs

6

Page 7: Comparing Service-based Architectures

System D (ftp only)

System A

System B

System C

System E (http only)

origins: hubs

7

Page 8: Comparing Service-based Architectures

System D (ftp only)

System A

System B

System C

System E (http only)

Integration Hub

origins: hubs

8

Page 9: Comparing Service-based Architectures

System D (ftp only)

System A

System B

System C

System E (http only)

Integration Hub

origins: hubs

9

Page 10: Comparing Service-based Architectures

System D (ftp only)

System A

System B

System C

System E (http only)

Integration Hub

origins: hubs

System B

10

Page 11: Comparing Service-based Architectures

looks great, but what about single point of failure and performance bottleneck considerations?

origins: hubs

11

Page 12: Comparing Service-based Architectures

orchestration

service oriented architecture / enterprise service bus pattern

hub

intelligent hub

12

Page 13: Comparing Service-based Architectures

service-oriented architecture

abstractionservice taxonomyshared resourcesmiddlewareinteroperability

13

Page 14: Comparing Service-based Architectures

message busprocess choreographer

service orchestrator

business services BS BS BS BS BS BS

enterprise services ES ES ES ES ES ES

application services AS infrastructure services IS

service-oriented architecture

14

Page 15: Comparing Service-based Architectures

message busprocess choreographer

service orchestrator

business services BS BS BS BS BS BS

enterprise services ES ES ES ES ES ES

application services AS infrastructure services IS

no implementation - only name, input, and output

ExecuteTrade PlaceOrder ProcessClaim

service-oriented architecture

Are we in the business of…?

abstract enterprise-level coarse-grained

owned and defined by business users data represented as WSDL, BPEL, XML, etc.

15

Page 16: Comparing Service-based Architectures

message busprocess choreographer

service orchestrator

business services BS BS BS BS BS BS

enterprise services ES ES ES ES ES ES

application services AS infrastructure services IS

custom or vendor implementations that are one-to-one or one-to-many relationship with business services

CreateCustomer CalcQuote ValidateTrade

service-oriented architecture

concrete enterprise-level coarse-grained

owned by shared services teams

16

Page 17: Comparing Service-based Architectures

message busprocess choreographer

service orchestrator

business services BS BS BS BS BS BS

enterprise services ES ES ES ES ES ES

application services AS infrastructure services IS

bound to a specific application context

AddDriver UpdateAddress CalcSalesTax

service-oriented architecture

concrete application-level fine-grained

owned by application teams

17

Page 18: Comparing Service-based Architectures

message busprocess choreographer

service orchestrator

business services BS BS BS BS BS BS

enterprise services ES ES ES ES ES ES

application services AS infrastructure services IS

implements non-business functionality to support both enterprise and business services

WriteAudit CheckUserAccess LogError

service-oriented architecture

concrete enterprise-level fine-grained

owned by infrastructure or shared services teams

18

Page 19: Comparing Service-based Architectures

message busprocess choreographer

service orchestrator

business services BS BS BS BS BS BS

enterprise services ES ES ES ES ES ES

application services AS infrastructure services IS

mediation and routingprocess choreographyservice orchestration

message enhancementmessage transformationprotocol transformation

service-oriented architecture

19

Page 20: Comparing Service-based Architectures

message bus

business services BS BS BS BS BS BS

enterprise services ES ES ES ES ES ES

mediation and routingservice-oriented architecture

20

Page 21: Comparing Service-based Architectures

message busprocess choreographer

business services BS BS BS BS BS BS

request request

process choreographyservice-oriented architecture

21

Page 22: Comparing Service-based Architectures

message bus

service orchestrator

enterprise services ES ES ES ES ES ES

request request

service orchestrationservice-oriented architecture

22

Page 23: Comparing Service-based Architectures

service registry

location, name, and implementation transparency

service-oriented architecture

CreateQuote calcQuote https://grid1/CalcQuote saveQuote rmi://atlas:1299/saveQuote

CreateQuotebusiness service

calcQuote() enterprise service

servicservice registry

service registry

enterprise servicesaveQuote()

23

Page 24: Comparing Service-based Architectures

servic enterprise service

client application

enhance message

03783310004/23/15

03783310004/23/15

contract decoupling

20462512015.04.23

AAPL

20462512015.04.23

AAPL

cusip, mm/dd/yy sedol, yyyy.mm.dd, symbol

message enhancementservice-oriented architecture

24

Page 25: Comparing Service-based Architectures

servic enterprise service

client application

transform message

xml xml

contract decoupling

java object java object

xml java object

message transformationservice-oriented architecture

25

Page 26: Comparing Service-based Architectures

SOAP/WS

access decoupling

servic enterprise service

client application

transform protocol

enterprise service

RMI/IIOP

ATMI

implementation transparency

protocol transformationservice-oriented architecture

26

Page 27: Comparing Service-based Architectures

message busprocess choreographer

service orchestrator

business services BS BS BS BS BS BS

enterprise services ES ES ES ES ES ES

application services AS infrastructure services IS

service-oriented architecture

27

Page 28: Comparing Service-based Architectures

CreateQuote

message bus

CreateCustomer CalcQuote

service-oriented architecture

AddDriver AddVehicle

message bus

CheckDMV

message bus

WriteAudit

message bus

28

Page 29: Comparing Service-based Architectures

message busprocess choreographer

service orchestrator

business services BS BS BS BS BS BS

enterprise services ES ES ES ES ES ES

application services AS infrastructure services IS

service-oriented architecture

maximize reusemaximize canonicality

29

Page 30: Comparing Service-based Architectures

message busprocess choreographer

service orchestrator

business services BS BS BS BS BS BS

enterprise services ES ES ES ES ES ES

application services AS infrastructure services IS

incremental changeoperationally coupled

service-oriented architecture

30

Page 31: Comparing Service-based Architectures

Microservice Architecture

31

Page 32: Comparing Service-based Architectures

domain driven design

32

Page 33: Comparing Service-based Architectures

bounded context

+

33

Page 34: Comparing Service-based Architectures

api layer

client requests client requests client requests

microservices architecture

34

Page 35: Comparing Service-based Architectures

api layer

client requests client requests client requests

microservices architecturedistributed architecture

35

Page 36: Comparing Service-based Architectures

api layer

client requests client requests client requests

microservices architectureseparately deployed components

36

Page 37: Comparing Service-based Architectures

api layer

client requests client requests client requests

microservices architectureservice component

37

Page 38: Comparing Service-based Architectures

api layer

client requests client requests client requests

microservices architecturebounded context

38

Page 39: Comparing Service-based Architectures

bounded context ≠ entity

checkout shipping

39

Page 40: Comparing Service-based Architectures

Customer

prefer duplication over coupling

checkout shippingSOA

40

Page 41: Comparing Service-based Architectures

prefer duplication over coupling

checkout shippingmicroservices

41

Page 42: Comparing Service-based Architectures

smart endpoints, dumb pipes

<— HTTP —><— messaging —>

42

Page 43: Comparing Service-based Architectures

standardize on integration, not platform

embrace polyglot solutions where sensible

too few languages/platforms

too many languages/platforms

Sam Newman

Building MicroservicesDESIGNING FINE-GRAINED SYSTEMS

Standardize in the gaps between services - be flexible about what

happens inside the boxes

Sam Newman

Building MicroservicesDESIGNING FINE-GRAINED SYSTEMS

Have one, two or maybe three ways of integrating, not 20.

Sam Newman

Building MicroservicesDESIGNING FINE-GRAINED SYSTEMS

Pick some sensible conventions, and stick with them.

43

Page 44: Comparing Service-based Architectures

technical consistency

service behavior

integration

downstream

metrics

Sam Newman

Building MicroservicesDESIGNING FINE-GRAINED SYSTEMS

Consider Service Templates to make it easy to do the right thing!

44

Page 45: Comparing Service-based Architectures

governancedecentralized

45

Page 46: Comparing Service-based Architectures

decentralized data management

versusACID BASE

46

Page 47: Comparing Service-based Architectures

data management

Sam Newman

Building MicroservicesDESIGNING FINE-GRAINED SYSTEMS

Avoid distributed transactions if at all possible

decentralized

47

Page 48: Comparing Service-based Architectures

infrastructure automation

48

Page 49: Comparing Service-based Architectures

service orchestrationmicroservices architecture

update customer

front orchestrator

process claims

process quotes

process adjustments

notification

49

Page 50: Comparing Service-based Architectures

service orchestrationmicroservices architecture

update customer

process claims

process quotes

process adjustments

notification

50

Page 51: Comparing Service-based Architectures

service orchestrationmicroservices architecture

update customer

process claims

process quotes

process adjustments

notification

51

Page 52: Comparing Service-based Architectures

service orchestrationmicroservices architecture

update customer

process claims

process quotes

process adjustments

notification

52

Page 53: Comparing Service-based Architectures

service orchestrationmicroservices architecture

update customer

process claims

process quotes

process adjustments

notification

53

Page 54: Comparing Service-based Architectures

consumer driven contractshttp://martinfowler.com/articles/consumerDrivenContracts.html

54

Page 55: Comparing Service-based Architectures

maximize easy evolution

api layer

client requests client requests client requests

microservices architecture

55

Page 56: Comparing Service-based Architectures

support ∆Microservice is the first

architectural style developed post-Continuous Delivery.

56

Page 57: Comparing Service-based Architectures

microservice implementation

http://2012.33degree.org/pdf/JamesLewisMicroServices.pdfhttp://www.infoq.com/presentations/Micro-Services

PCI Level 1 !!

57

Page 58: Comparing Service-based Architectures

Service-based Architecture

58

Page 59: Comparing Service-based Architectures

service-oriented architecture

microservices architecture

service-based architecture

is there a middle ground?service-based architecture

59

Page 60: Comparing Service-based Architectures

service-based architecture

service granularity

database scope

integration hub

60

Page 61: Comparing Service-based Architectures

api layer

client requests client requests client requests

service granularityservice-based architecture

61

Page 62: Comparing Service-based Architectures

user interface layer

client requests client requests client requests

service granularityservice-based architecture

62

Page 63: Comparing Service-based Architectures

single-purpose micro-service to "portion of the application" macro-service

service granularity

macro-services resolves orchestration and transactional issuesallows for complex business processing within a service context

-

service-based architecture

63

Page 64: Comparing Service-based Architectures

single-purpose micro-service to "portion of the application" macro-service

service granularity

services become harder to develop and testdeployment pipeline requires more planningchange control becomes more difficult

-

service-based architecture

64

Page 65: Comparing Service-based Architectures

database scope

api layer

client requests client requests client requests

service-based architecture

65

Page 66: Comparing Service-based Architectures

database scope

user interface layer

client requests client requests client requests

service-based architecture

66

Page 67: Comparing Service-based Architectures

single-purpose service-based database to globally shared application database

reduces service orchestration and contract dependencies

database scope

improves performance due to fewer remote callsrefactoring entire database may not be feasible or possible

-

service-based architecture

67

Page 68: Comparing Service-based Architectures

single-purpose service-based database to globally shared application database

looser bounded context of servicestighter service coupling based on schema

database scope

schema changes become expensive and difficult

-

service-based architecture

68

Page 69: Comparing Service-based Architectures

integration hub

api layer

client requests client requests client requests

lightweight message broker

service-based architecture

69

Page 70: Comparing Service-based Architectures

user interface layer

client requests client requests client requests

integration hub

integration hub / middleware

service-based architecture

70

Page 71: Comparing Service-based Architectures

lightweight message broker to heavier integration hub

integration hub

allows for transformation of contract differences allows for non-transactional orchestration of servicesallows for protocol-agnostic heterogeneous interoperabilityallows for common processing logic across all services

-

service-based architecture

71

Page 72: Comparing Service-based Architectures

lightweight message broker to heavier integration hub

decrease in overall performanceadded complexity and costincreased need for governancedeployment pipeline requires much more planning

integration hub

services become harder to develop and test-

service-based architecture

72

Page 73: Comparing Service-based Architectures

what people really mean when they say “microservice”:

A domain-centric service based architecture with modern DevOps practices.

73

Page 74: Comparing Service-based Architectures

migrating architectures

74

Page 75: Comparing Service-based Architectures

electronics recycling application

kiosk

quote accounting

reporting

item status assessment

receiving

recycling

public requests receiving department recycling and accounting

75

Page 76: Comparing Service-based Architectures

electronics recycling application

public uikiosk receiving ui recycling ui

76

Page 77: Comparing Service-based Architectures

adding microservices

user interface layer

client requests client requests client requests

service-based architecture

77

Page 78: Comparing Service-based Architectures

adding microservices

user interface layer

client requests client requests client requests

service-based architecture

78

Page 79: Comparing Service-based Architectures

adding microservices

user interface layer

client requests client requests client requests

service-based architecture

79

Page 80: Comparing Service-based Architectures

Micro Service-oriented

Service-based

comparing:

80

Page 81: Comparing Service-based Architectures

characteristics differences

ov

erall

agilit

y L

H

M

overall agility ability to respond quickly to

constant change in both business and technology

microservices architecture

service-oriented architecture

service-based architecture

monolithic architecture

81

Page 82: Comparing Service-based Architectures

characteristics differences

ea

se o

f dep

loym

ent

L

H

M

ease of deployment promotes an effective and fast

deployment pipeline; features are quick and easy to deploy

microservices architecture

service-oriented architecture

service-based architecture

monolithic architecture

82

Page 83: Comparing Service-based Architectures

characteristics differences

ea

se o

f tes

ting

L

H

M

ease of testing ease at which features can be

tested and verified; confidence level in completeness of testing

microservices architecture

service-oriented architecture

service-based architecture

monolithic architecture

83

Page 84: Comparing Service-based Architectures

characteristics differences

lev

el of

per

form

ance

L

H

M

overall performance which patterns relatively

promote better performing applications?

microservices architecture

service-oriented architecture

service-based architecture

monolithic architecture

84

Page 85: Comparing Service-based Architectures

characteristics differences

lev

el of

scala

bilit

y L

H

M

overall scalability how well does the architecture

pattern lend itself to highly scalable applications?

microservices architecture

service-oriented architecture

service-based architecture

monolithic architecture

85

Page 86: Comparing Service-based Architectures

characteristics differences

lev

el of

sim

plici

ty L

H

M

overall simplicity level of complexity in

applications implemented using the architecture pattern

microservices architecture

service-oriented architecture

service-based architecture

monolithic architecture

86

Page 87: Comparing Service-based Architectures

microservices architecture

service-oriented architecture

service-based architecture

service numbers service granularity

service differences

87

Page 88: Comparing Service-based Architectures

service differences service granularity what is the typical granularity of services within this pattern?

microservices architecture

service-oriented architecture

service-based architecture

coarse-grained fine-grained

88

Page 89: Comparing Service-based Architectures

service differences service numbers what is the typical upper limit of the number of services found?

microservices architecture

service-oriented architecture

service-based architecture

0 50 300 800 1000

89

Page 90: Comparing Service-based Architectures

Which ?!?

90

Page 91: Comparing Service-based Architectures

Which ?!?

default

easy to understand/build

doesn’t scale well in any dimension

Monolith

91

Page 92: Comparing Service-based Architectures

Which ?!?

service taxonomy

high degree of (potential) reuse

highly compatible in integration-heavy environments

operationally complex

Service-oriented

92

Page 93: Comparing Service-based Architectures

Which ?!?

incremental change

highly evolvable

complex interactions

Microservices

93

Page 94: Comparing Service-based Architectures

Which ?!?

best target for migration

good compromise

domain-centric without going µservice

service-based

94

Page 95: Comparing Service-based Architectures

Which ?!?

it depends

95

Page 96: Comparing Service-based Architectures

domain/architecture isomorphism

mechanical sympathy

96

Page 97: Comparing Service-based Architectures

nealford.com

@neal4d

nealford.com/books

nealford.com/videos

www.oreilly.com/software-architecture-video-training-series.html

97