Comparing Service- based Architectures

@neal4d nealford.com

1 agenda

Micro Service-oriented

Service-based

2 Service-oriented Architecture

3 origins: hubs

System B

System A

System C

4 origins: hubs

System B

System A

System C

System D (ftp only)

5 origins: hubs

System E (http only)

System B

System A

System C

System D (ftp only)

6 origins: hubs

System E (http only)

System B

System A

System C

System D (ftp only)

7 origins: hubs

System E (http only)

System B

Integration System A Hub

System C

System D (ftp only)

8 origins: hubs

System E (http only)

System B

Integration System A Hub

System C

System D (ftp only)

9 origins: hubs

System E (http only)

System B

Integration System A Hub

System C

System D (ftp only)

10 origins: hubs looks great, but what about single point of failure and performance bottleneck considerations?

11 orchestration

hub

intelligent hub

service oriented architecture / enterprise service bus pattern

12 service-oriented architecture

abstraction service taxonomy shared resources middleware interoperability

13 service-oriented architecture

business services BS BS BS BS BS BS

message bus

choreographer

service orchestrator

enterprise services ES ES ES ES ES ES

application services AS infrastructure services IS

14 service-oriented architecture

business services BS BS BS BS BS BS

messageabstract bus enterprise-level coarse-grained process choreographer owned and defined by business users data represented as WSDL, BPEL, XML, etc. service orchestrator no implementation - only name, input, and output

enterpriseAre we services in the businessES ES ES of…?ES ES ES

ExecuteTrade application services ASPlaceOrder infrastructureProcessClaim services IS

15 service-oriented architecture

owned by shared services teams business services BS BS BS BS BS BS concrete message bus enterprise-level coarse-grained

process choreographer

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

enterprise services ES ES ES ES ES ES

application services AS infrastructure services IS CreateCustomer CalcQuote ValidateTrade

16 service-oriented architecture

owned by application teams business services BS BS BS BS BS BS concrete message bus application-level fine-grained

process choreographer

bound to a specificservice application orchestrator context

AddDriver UpdateAddress CalcSalesTax enterprise services ES ES ES ES ES ES

application services AS infrastructure services IS

17 service-oriented architecture

owned by infrastructure or shared services teams business services BS BS BS BS BS BS concrete message bus enterprise-level fine-grained

process choreographer implements non-business functionality to support both enterprise and businessservice services orchestrator

WriteAudit CheckUserAccess LogError enterprise services ES ES ES ES ES ES

application services AS infrastructure services IS

18 service-oriented architecture

business services BS BS BS BS BS BS

message bus

process choreographer

service orchestrator

mediation and routing message enhancement enterprise services ES ES ES ES ES ES process choreography message transformation AS IS service application orchestration services infrastructureprotocol transformation services

19 service-oriented architecture mediation and routing

business services BS BS BS BS BS BS

message bus

enterprise services ES ES ES ES ES ES

20 service-oriented architecture process choreography

request request

business services BS BS BS BS BS BS

message bus

process choreographer

21 service-oriented architecture service orchestration

request request

message bus

service orchestrator

enterprise services ES ES ES ES ES ES

22 service-oriented architecture service registry

calcQuote() enterprise service business service servic service registry CreateQuote enterprise saveQuote() service location, name, and CreateQuote implementation calcQuote https://grid1/CalcQuote transparency service saveQuote registry rmi://atlas:1299/saveQuote

23 service-oriented architecture message enhancement

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

client enhance enterprise servic application message service

037833100 037833100 2046251 2046251 04/23/15 04/23/15 2015.04.23 2015.04.23 AAPL AAPL

contract decoupling

24 service-oriented architecture message transformation

xml java object

client transform enterprise servic application message service

xml xml java object java object

contract decoupling

25 service-oriented architecture protocol transformation

SOAP/WS RMI/IIOP client transform enterprise servic application protocol service

ATMI enterprise service

access decoupling implementation transparency

26 service-oriented architecture

business services BS BS BS BS BS BS

message bus

process choreographer

service orchestrator

enterprise services ES ES ES ES ES ES

application services AS infrastructure services IS

27 service-oriented architecture

CreateQuote

message bus

CreateCustomer CalcQuote

message bus message bus

AddDriver AddVehicle CheckDMV

message bus

WriteAudit

28 service-oriented architecture

business services BS BS BS BS BS BS

message bus

process choreographer

service orchestrator

enterprise services ES ES ES ES ES ES

application services AS infrastructure services IS maximize reuse maximize canonicality

29 service-oriented architecture

business services BS BS BS BS BS BS

message bus

process choreographer

service orchestrator

enterprise services ES ES ES ES ES ES

application services AS infrastructure services IS incremental change operationally coupled

30 Microservice Architecture

31 domain driven design

32 bounded context

+

33 architecture

client requests client requests client requests

layer

34 microservices architecture distributed architecture

client requests client requests client requests

api layer

35 microservices architecture separately deployed components

client requests client requests client requests

api layer

36 microservices architecture service component

client requests client requests client requests

api layer

37 microservices architecture bounded context

client requests client requests client requests

api layer

38 bounded context ≠ entity

checkout shipping

39 prefer duplication over coupling

checkout SOA shipping

Customer

40 prefer duplication over coupling

checkout microservices shipping

41 smart endpoints, dumb pipes

<— HTTP —> <— messaging —>

42 standardize on integration, not platform

embrace polyglot solutions where sensible

too few too many Building languages/platforms Microservices languages/platforms

DESIGNING FINE-GRAINED SYSTEMS

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

Sam Newman Building Microservices DESIGNING FINE-GRAINED SYSTEMS Building Microservices Standardize in the gaps between DESIGNING FINE-GRAINED SYSTEMS services - be flexible about what Pick some sensible conventions, happens inside the boxes

Sam Newman and stick with them.

Sam Newman

43 technical consistency

integration

metrics service behavior

Building downstream Microservices

DESIGNING FINE-GRAINED SYSTEMS

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

Sam Newman

44 decentralized governance

45 decentralized data management

ACID versus BASE

46 d ecentralized data management

Building Microservices

DESIGNING FINE-GRAINED SYSTEMS

Avoid distributed transactions if at all possible

Sam Newman

47 infrastructure automation

48 microservices architecture service orchestration

process process process claims quotes adjustments

update customer notification

front orchestrator

49 microservices architecture service orchestration

process process process claims quotes adjustments

update customer notification

50 microservices architecture service orchestration

process process process claims quotes adjustments

update customer notification

51 microservices architecture service orchestration

process process process claims quotes adjustments

update customer notification

52 microservices architecture service orchestration

process process process claims quotes adjustments

update customer notification

53 consumer driven contracts http://martinfowler.com/articles/consumerDrivenContracts.html

54 microservices architecture

client requests client requests client requests

api layer

maximize easy evolution

55 support ∆

Microservice is the first architectural style developed post-.

56 microservice implementation

PCI Level 1 !! http://2012.33degree.org/pdf/JamesLewisMicroServices.pdf http://www.infoq.com/presentations/Micro-Services

57 Service-based Architecture

58 service-based architecture is there a middle ground?

service-oriented microservices architecture architecture

service-based architecture

59 service-based architecture

service integration granularity scope hub

60 service-based architecture service granularity

client requests client requests client requests

api layer

61 service-based architecture service granularity

client requests client requests client requests

user interface layer

62 service-based architecture service granularity

single-purpose micro-service to "portion of the application" macro-service macro-services resolves orchestration and transactional issues

allows for complex business processing within a service context

-

63 service-based architecture service granularity

single-purpose micro-service to "portion of the application" macro-service services become harder to develop and test deployment pipeline requires more planning change control becomes more difficult

-

64 service-based architecture database scope

client requests client requests client requests

api layer

65 service-based architecture database scope

client requests client requests client requests

user interface layer

66 service-based architecture database scope

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

reduces service orchestration and contract dependencies improves performance due to fewer remote calls refactoring entire database may not be feasible or possible

-

67 service-based architecture database scope

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

looser bounded context of services tighter service coupling based on schema schema changes become expensive and difficult

-

68 service-based architecture integration hub

client requests client requests client requests

api layer

lightweight message broker

69 service-based architecture integration hub

client requests client requests client requests

user interface layer

integration hub / middleware

70 service-based architecture integration hub

lightweight message broker to heavier integration hub

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

-

71 service-based architecture integration hub

lightweight message broker to heavier integration hub

decrease in overall performance added complexity and cost increased need for governance deployment pipeline requires much more planning services become harder to develop and test -

72 what people really mean when they say “microservice”:

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

73 migrating architectures

74 electronics recycling application

public requests receiving department recycling and accounting

kiosk

receiving accounting quote

assessment recycling item status

reporting

75 electronics recycling application

kiosk public ui receiving ui recycling ui

76 service-based architecture adding microservices

client requests client requests client requests

user interface layer

77 service-based architecture adding microservices

client requests client requests client requests

user interface layer

78 service-based architecture adding microservices

client requests client requests client requests

user interface layer

79 comparing:

Micro Service-oriented

Service-based

80 characteristics differences

overall agility H ability to respond quickly to constant change in both business and technology

M

monolithic service-based overall agility

architecture architecture

L

service-oriented microservices architecture architecture

81 characteristics differences

ease of deployment

promotes an effective and fast H deployment pipeline; features are quick and easy to deploy

M

monolithic service-based architecture architecture ease of deployment

L

service-oriented microservices architecture architecture

82 characteristics differences

ease of testing ease at which features can be H tested and verified; confidence level in completeness of testing

M

monolithic service-based ease of testing architecture architecture

L

service-oriented microservices architecture architecture

83 characteristics differences

overall performance H which patterns relatively promote better performing applications?

M

monolithic service-based architecture architecture level of performance

L

service-oriented microservices architecture architecture

84 characteristics differences

overall H how well does the architecture pattern lend itself to highly scalable applications?

M

monolithic service-based architecture architecture level of scalability

L

service-oriented microservices architecture architecture

85 characteristics differences

overall simplicity H level of complexity in applications implemented using the architecture pattern

M

monolithic service-based architecture architecture level of simplicity

L

service-oriented microservices architecture architecture

86 service differences

service-oriented microservices service-based architecture architecture architecture

service granularity service numbers

87 service differences

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

microservices architecture

service-based architecture

service-oriented architecture fine-grained coarse-grained

88 service differences

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

microservices architecture

service-based architecture

service-oriented architecture 0 50 300 800 1000

89 Which ?!?

90 Which ?!?

Monolith

default easy to understand/build doesn’t scale well in any dimension

91 Which ?!?

Service-oriented service taxonomy high degree of (potential) reuse highly compatible in integration-heavy environments operationally complex

92 Which ?!?

Microservices

incremental change highly evolvable complex interactions

93 Which ?!?

service-based

best target for migration good compromise domain-centric without going µservice

94 Which ?!? it depends

95 domain/architecture isomorphism

mechanical sympathy

96 nealford.com

@neal4d

nealford.com/videos

nealford.com/books

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

97