Is Microservices SOA Done Right?
-
Upload
apigee-google-cloud -
Category
Technology
-
view
5.843 -
download
1
Transcript of Is Microservices SOA Done Right?
©2015 Apigee Corp. All Rights Reserved. 1
©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
©2015 Apigee Corp. All Rights Reserved.
Matt Stine!Senior Product Manager - Pivotal Software, Inc.
Author of:!http://bit.ly/cloud-native-book
©2015 Apigee Corp. All Rights Reserved.
Alan Ho!Head of Developer Programs – Apigee
Author of:!
MICRO
Just Joking
©2015 Apigee Corp. All Rights Reserved.
Some Companies Has Helped with Microservices!
5
©2015 Apigee Corp. All Rights Reserved.
Some Companies Has Helped with Microservices!
6
©2015 Apigee Corp. All Rights Reserved.
How do you fix your last SOA deployment (joke) !
7
©2015 Apigee Corp. All Rights Reserved.
More (micro)Services !!
8
©2015 Apigee Corp. All Rights Reserved.
Think Graphs, Not Layers!!
9
©2015 Apigee Corp. All Rights Reserved.
Not Monoliths!
Relational Database
Data Access
Service
HTML JavaScript MVC
Service
Monolithic Application Browser
©2015 Apigee Corp. All Rights Reserved.
Enterprise Service Bus
Service Service Service Service
Service Service Service Service
UI UI
Not Traditional (ESB-centric) SOA!
©2015 Apigee Corp. All Rights Reserved.
But Microservices!!
©2015 Apigee Corp. All Rights Reserved.
No Microservice is an Island!!
13
©2015 Apigee Corp. All Rights Reserved.
Example Distributed System: Minified!
Some emergent challenges of microservices systems…!
� Configuration Management !� Service Registration & Discovery !� Routing & Load Balancing !� Fault Tolerance (Circuit Breakers!) !� Monitoring !
©2015 Apigee Corp. All Rights Reserved.
Example: Coordination Boiler Plate!
©2015 Apigee Corp. All Rights Reserved.
Think Frameworks,!Not Enterprise Architecture!
17
• Eureka!• Hystrix + Turbine!• Ribbon!• Feign!• Zuul!
http://netflix.github.io
©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
©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
http://projects.spring.io/spring-cloud!
©2015 Apigee Corp. All Rights Reserved.
Example: Spring Cloud + Netflix OSS!
©2015 Apigee Corp. All Rights Reserved.
So many more frameworks!
23
©2015 Apigee Corp. All Rights Reserved.
What is a Microservice Anyway?!
24
©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!
©2015 Apigee Corp. All Rights Reserved.
Smaller services than my last SOA deployment
Alternate Definition: Microservice!
©2015 Apigee Corp. All Rights Reserved.
One Data Model to Bind Them…
Movie Actor
Genre
Media Type Kiosk
Location
Media
Review Customer
Reservation
©2015 Apigee Corp. All Rights Reserved. 28
Movie Movie
Actor
Genre
Media Type
Media Type
Kiosk
Location
Media
Product Catalog
Inventory
Bounded Contexts!
©2015 Apigee Corp. All Rights Reserved.
Shared Database!
Service X Service Y Service Z
©2015 Apigee Corp. All Rights Reserved.
Database per Service!
Service X Service Y Service Z
©2015 Apigee Corp. All Rights Reserved.
Polyglot Persistence!
Service X Service Y Service Z
©2015 Apigee Corp. All Rights Reserved.
Understanding Performance = !Understanding Probability!
32
©2015 Apigee Corp. All Rights Reserved.
Joint probability governs microservice behavior!
33
Availability Challenge
Latency Challenge
Serial Parallel
©2015 Apigee Corp. All Rights Reserved.
Understanding Availability!
34
Actual availability: 100 – (1% x 7) =
93%
Assume each service has a 99% availability
©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)
©2015 Apigee Corp. All Rights Reserved.
Techniques to improve latency + availability!
• Caching (2 types) !
• Retry & Cancellation & Timeout !!• Distributed Tracing !
36
©2015 Apigee Corp. All Rights Reserved.
No Caching!
37
Latency : 200 ms
TP99: 2 s
Availability: 97%
©2015 Apigee Corp. All Rights Reserved.
Caching with 50% hit rate!
38
Request Cache Latency :
150 ms
TP99: ~1.5 s
Availability: 98%
©2015 Apigee Corp. All Rights Reserved.
Caching with 100% hit rate!
39
Latency : 100 ms
TP99: 1 s
Availability: 99%
NoSQL
©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%
©2015 Apigee Corp. All Rights Reserved.
Caching Tools from Apigee!
41
API
Gat
eway
Cache
©2015 Apigee Corp. All Rights Reserved.
Cache Analytics!
42
©2015 Apigee Corp. All Rights Reserved.
API BaaS (Apache Usergrid)!
43
C* Elastic Search
• Webscale
• APIs out of box
• Best of NoSQL Technologies
©2015 Apigee Corp. All Rights Reserved.
Retries & Cancelation & Timeout!
44
Availability: 97.9% or more
Assume 3 retries
Beware self-inflicted DOS attacks
©2015 Apigee Corp. All Rights Reserved.
More Tools!
45
SDK
©2015 Apigee Corp. All Rights Reserved.
Distributed Tracing!
46
©2015 Apigee Corp. All Rights Reserved.
Think Consumption APIs, Not one-size-fits-all!
47
©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)
©2015 Apigee Corp. All Rights Reserved.
Ownership that Scales!
49
Doesn’t Scale Scales
©2015 Apigee Corp. All Rights Reserved.
Real World Example - Belly!
50
©2015 Apigee Corp. All Rights Reserved. 51
©2015 Apigee Corp. All Rights Reserved.
Belly’s Experience Focused APIs!
52
©2015 Apigee Corp. All Rights Reserved.
Building “Microservices” in Apigee Edge!
53
©2015 Apigee Corp. All Rights Reserved.
Other Platforms for Experience APIs!
54
©2015 Apigee Corp. All Rights Reserved.
1 + 1 = 3 ?!
55
©2015 Apigee Corp. All Rights Reserved.
Apigee + Pivotal Integration Preview!
56
©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
©2015 Apigee Corp. All Rights Reserved. 58
©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
community.apigee.com
https://community.apigee.com/questions/20895/is-microservices-soa-done-right.html
Thank you!