is microservices soa done right?

61
©2015 Apigee Corp. All Rights Reserved. 1

Upload: apigee-google-cloud

Post on 16-Apr-2017

5.842 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved. 1

Page 2: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Slideshare slideshare.com/apigee

Apigee Community https://community.apigee.com

YouTube"youtube.com/apigee

https://community.apigee.com/questions/20895/is-microservices-soa-done-right.html

Page 3: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Matt Stine!Senior Product Manager - Pivotal Software, Inc.

Author of:!http://bit.ly/cloud-native-book

Page 4: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Alan Ho!Head of Developer Programs – Apigee

Author of:!

MICRO

Just Joking

Page 5: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Some Companies Has Helped with Microservices!

5

Page 6: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Some Companies Has Helped with Microservices!

6

Page 7: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

How do you fix your last SOA deployment (joke) !

7

Page 8: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

More (micro)Services !!

8

Page 9: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Think Graphs, Not Layers!!

9

Page 10: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Not Monoliths!

Relational Database

Data Access

Service

HTML JavaScript MVC

Service

Monolithic Application Browser

Page 11: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Enterprise Service Bus

Service Service Service Service

Service Service Service Service

UI UI

Not Traditional (ESB-centric) SOA!

Page 12: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

But Microservices!!

Page 13: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

No Microservice is an Island!!

13

Page 14: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Example Distributed System: Minified!

Page 15: Is Microservices SOA Done Right?

Some emergent challenges of microservices systems…!

�  Configuration Management !�  Service Registration & Discovery !�  Routing & Load Balancing !�  Fault Tolerance (Circuit Breakers!) !�  Monitoring !

Page 16: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Example: Coordination Boiler Plate!

Page 17: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Think Frameworks,!Not Enterprise Architecture!

17

Page 18: Is Microservices SOA Done Right?

•  Eureka!•  Hystrix + Turbine!•  Ribbon!•  Feign!•  Zuul!

http://netflix.github.io

Page 19: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

•  Opinionated convention over configuration !

•  Simplified dependency management with STARTERS !

•  Standalone executable JARs with choice of embedded runtime !

•  Production-readiness with metrics, health checks, introspection !

Spring Boot: Foundation for Twelve-Factor Apps!

19

Spring Boot!http://projects.spring.io/spring-boot

Page 20: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Spring Boot Adoption!

20

Source: oss.sonatype.org

3.05M

0

500,000

1,000,000

1,500,000

2,000,000

2,500,000

3,000,000

3,500,000

Feb-15 Mar-15 Apr-15 May-15 Jun-15 Jul-15 Aug-15 Sep-15 Oct-15 Nov-15 Dec-15 Jan-16 Feb-16

Monthly Maven downloads

Page 21: Is Microservices SOA Done Right?

http://projects.spring.io/spring-cloud!

Page 22: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Example: Spring Cloud + Netflix OSS!

Page 23: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

So many more frameworks!

23

Page 24: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

What is a Microservice Anyway?!

24

Page 25: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Loosely coupled service oriented architecture with bounded contexts

If every service has to be updated in concert, it’s not loosely coupled!

If you have to know about surrounding services you don’t have a bounded context.

DEFINE: Microservice!

Page 26: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Smaller services than my last SOA deployment

Alternate Definition: Microservice!

Page 27: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

One Data Model to Bind Them…

Movie Actor

Genre

Media Type Kiosk

Location

Media

Review Customer

Reservation

Page 28: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved. 28

Movie Movie

Actor

Genre

Media Type

Media Type

Kiosk

Location

Media

Product Catalog

Inventory

Bounded Contexts!

Page 29: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Shared Database!

Service X Service Y Service Z

Page 30: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Database per Service!

Service X Service Y Service Z

Page 31: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Polyglot Persistence!

Service X Service Y Service Z

Page 32: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Understanding Performance = !Understanding Probability!

32

Page 33: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Joint probability governs microservice behavior!

33

Availability Challenge

Latency Challenge

Serial Parallel

Page 34: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Understanding Availability!

34

Actual availability: 100 – (1% x 7) =

93%

Assume each service has a 99% availability

Page 35: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Understanding Latency!

35

Average Latency 500ms

Assume each service has a mean of 100ms processing time and a TP99 of 1s

TP99 ~ 5 sec

(Assuming statistical correlation)

Page 36: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Techniques to improve latency + availability!

•  Caching (2 types) !

•  Retry & Cancellation & Timeout !!•  Distributed Tracing !

36

Page 37: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

No Caching!

37

Latency : 200 ms

TP99: 2 s

Availability: 97%

Page 38: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Caching with 50% hit rate!

38

Request Cache Latency :

150 ms

TP99: ~1.5 s

Availability: 98%

Page 39: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Caching with 100% hit rate!

39

Latency : 100 ms

TP99: 1 s

Availability: 99%

NoSQL

Page 40: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Caching !

40

Request Caching

with 50% Hit

Forward Cache

(NoSQL)

Average Latency: 100 + (100+200)/2 + 100 = 350ms

TP 99 ~ 3.5 seconds

Availability: 96%

Page 41: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Caching Tools from Apigee!

41

API

Gat

eway

Cache

Page 42: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Cache Analytics!

42

Page 43: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

API BaaS (Apache Usergrid)!

43

C* Elastic Search

•  Webscale

•  APIs out of box

•  Best of NoSQL Technologies

Page 44: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Retries & Cancelation & Timeout!

44

Availability: 97.9% or more

Assume 3 retries

Beware self-inflicted DOS attacks

Page 45: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

More Tools!

45

SDK

Page 46: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Distributed Tracing!

46

Page 47: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Think Consumption APIs, Not one-size-fits-all!

47

Page 48: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Consumption APIs !

48

•  Each Client has its own microservice (with an API) !

•  Downstream services are granular and focused on reuse !

Credits : Sam Newman

(Backend for Frontends / Experience APIs)

Page 49: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Ownership that Scales!

49

Doesn’t Scale Scales

Page 50: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Real World Example - Belly!

50

Page 51: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved. 51

Page 52: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Belly’s Experience Focused APIs!

52

Page 53: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Building “Microservices” in Apigee Edge!

53

Page 54: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Other Platforms for Experience APIs!

54

Page 55: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

1 + 1 = 3 ?!

55

Page 56: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Apigee + Pivotal Integration Preview!

56

Page 57: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Apigee Edge

Pivotal Cloud Foundry

Runtime Traffic – Apigee Route Service!

57

API Client

Load

Bala

ncer

Go Router App

(Spring Boot)

Route Service (Proxy)

Management API

Unless otherwise noted, all traffic in HTTP/S

Page 58: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved. 58

Page 59: Is Microservices SOA Done Right?

©2015 Apigee Corp. All Rights Reserved.

Conclusion!

• Think Graphs, Not Layers! !• No Microservice is an Island! !• Think Frameworks, not Processes! !• Understand Performance = Understand Probability !• Think Consumption APIs, Not one-size-fits-all! !• Check us out at CloudFoundary Summit !

59

Page 60: Is Microservices SOA Done Right?

community.apigee.com

https://community.apigee.com/questions/20895/is-microservices-soa-done-right.html

Page 61: Is Microservices SOA Done Right?

Thank you!