(pfc304) effective interprocess communications in the cloud: the pros and cons of microservices...

111

Upload: amazon-web-services

Post on 24-Jun-2015

2.282 views

Category:

Technology


2 download

DESCRIPTION

You can't (yet) bend the law of Physics, but you can use the power of the cloud to design applications that run as fast as the speed of light! This session will focus on the best practices for optimizing performance to the very last millisecond. We'll dive into topics such as caching at every layer of your application, TCP optimizations, SSL optimizations, latency based routing, and much more. These best practices can help you to streamline your infrastructure utilization, improve performance and allow you to scale economically.

TRANSCRIPT

Page 1: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 2: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 3: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

• Netflix – background and evolution

Page 4: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 5: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 6: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 7: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

• Netflix – background and evolution

• Monolithic Apps

Page 8: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 9: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 10: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Load Balancer

Monolithic App

Account

ComponentCatalog

Component

Recommendation

Component

Customer Service

Component

Database

Page 11: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 12: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Time

Page 13: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 14: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 15: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 16: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

User Accounts

Shopping Cart

Product Catalog

Customer Service

Page 17: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 18: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Product Catalog Customer Service

Page 19: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 20: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 21: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 22: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Tipping Point

& &

Organizational Growth Disverse Functionality Bottleneck in

Monolithic stack

Page 23: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

MicroServices

Perhaps?

Page 24: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

• Netflix – background and evolution

• Monolithic Apps

• Microservices

Page 25: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 26: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 27: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

MicroService

MegaService

Page 28: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Attribution: Adrian Cockroft, Martin Fowler …

Page 29: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

• Write programs that do one thing and do it well.

• Write programs to work together.

tr 'A-Z' 'a-z' < doc.txt | tr -cs 'a-z' '\n' | sort | uniq | comm -23 -

/usr/share/dict/words

Program to print misspelt words in doc.txt

Page 30: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Comparing Monolithic to MicroServices

Page 31: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 32: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Load Balancer

Monolithic App

Account

ComponentCatalog

Component

Recommendation

Component

Customer Service

Component

Database

Page 33: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Load Balancer

Account

ServiceCatalog

Service

Recommendation

ServiceCustomer Service

Service

Catalog

DB

API Gateway

Customer

DB

Page 34: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

• Netflix – background and evolution

• Monolithic Apps

• Microservices

– Why?

Page 35: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 36: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 37: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Your

App/Service

Service X

Service Y

Service Z

Service L

Service M

Page 38: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

• Netflix – background and evolution

• Monolithic Apps

• Microservices

– Challenges and Solutions

Page 39: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 40: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Vs

Page 41: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Heterogeneity

Can lead to chaos if not designed right …

Page 42: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 43: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 44: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

non-JVM

Page 45: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 46: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Service Discovery

What’s your address?

Page 47: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Account

ServiceCatalog

Service

Recommendation

ServiceCustomer Service

Service

X

Service Y

Service

Z

Service

Registry

Service

(e.g. Netflix Eureka)

Page 48: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 49: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

2 Billion

~20 Billion Fan

1 Request 1 Request

Monolithic

AppMicroServices

Page 50: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 51: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Your

App/Service

Service X

Service Y

Service Z

Cache

ClusterCache

Cluster

Tip: Config your TTL based on flexibility with data staleness!

Page 52: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Your

App/Service

Service X

Service Y

Service Z

Cache

Cluster

Fn {A, B, C}

Cache

Cluster

Page 53: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 54: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

A/B Test

Service

User Account

Service

Service X Service Y Service ZApp

Page 55: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

A/B Test

Service

User Account

Service

Service X Service Y Service ZApp

reduces dependency

load

Page 56: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 57: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Data Serialization Overhead

Service A Service B Service C Service D

getMovies() getMovie() getMovieMetadata(

)C

l

i

e

n

t

D

C

l

i

e

n

t

C

C

l

i

e

n

t

B

Data

transformation

XAvroX

XmlJSON

Overall Response Time

Page 58: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 59: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 60: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

A single “bad” service can still bring your service down

Page 61: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 62: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 63: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Your

App/Service

Service X

Service Y

Service Z

Service L

Service M

Page 64: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Your

App/Service

Service X

Service Y

Service Z

Service L

Service M

Your

App/ServiceYour

App/Service

Page 65: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Your

App/Service

Service X

Service Y

Service Z

Service L

Service M

Your

App/ServiceYour

App/Service

Service X

Service Y

Service Z

Service L

Service M

Page 66: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/WhatIsAutoScaling.html

Page 67: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

http://techblog.netflix.com/2013/11/scryer-

netflixs-predictive-auto-scaling.html

Page 68: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

1.

Page 69: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Account

Service 1

Recommendation

Service 1

Customer Service

Service 1

API Gateway

Account

Service N

Recommendation

Service N

Customer Service

Service N

Customer Service

Load Balancer

Reco Service

Load Balancer

Account Service

Load Balancer

ELB

Page 70: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 71: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Account

Service 1

Recommendation

Service 1

Customer Service

Service 1

API Gateway

Account

Service N

Recommendation

Service N

Customer Service

Service N

Account Service

LB

Recommendation

Service LB

Customer Service

Service LB

ELB

Page 72: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

http://github.com/netflix/ribbon

Page 73: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 74: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Service Dependency Visualization

Page 75: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Your Service

XY Farm

Page 76: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

How many dependencies does my service have?

What is the Call Volume on my Service?

Are any Dependency Services running Hot?

What are the Top N Slowest “Business Transactions”?

What are the sample HTTP Requests/Responses that had a

500 Error Code in the last 30 minutes?

Page 77: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

You

Your Service Dependency

Graph

Page 78: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 79: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 80: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 81: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 82: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 83: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 84: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

• Netflix – background and evolution

• Monolithic Apps

• Microservices

– Challenges and Solutions

– Best Practices

Page 85: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 86: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html

Page 87: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 88: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 89: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

three

Page 90: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 91: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 92: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Fault Injection Testing (FIT)

Device ELB Service B

Service C

Internet Edge

Device or Account Override

Zuul

Service A

Request-level simulations

Refer Re:Invent Talk “Embracing Failure: Fault Injection and

Service Reliability” – PFC305

Page 93: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

https://github.com/Netflix/SimianArmy

Page 94: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 95: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 96: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

• Netflix – background and evolution

• Monolithic Apps

• Microservices

– Challenges and Solutions

– Best Practices

• InterProcess Communication

Page 97: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 98: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Netflix IPC Stack (1.0)

A

p

a

c

h

e

H

T

T

P

C

l

i

e

n

t

Eureka (Service

Registry)

Server (Karyon)

Apache

Tomcat

Client

H

y

s

t

r

i

x

E

V

C

a

c

h

e

Ribbon

Load

Balancing

Eureka

Integration

Metrics

(Servo)

Bootstrapping (Governator)

Metrics (Servo)

Admin ConsoleHTTP

Eureka Integration

Registration

Fetch Registry

A Blocking Architecture

Page 99: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Netflix IPC Stack (2.0)Client (Ribbon 2.0)

Eureka (Service

Registry)

Server (Karyon)

Ribbon Transport

Load

Balancing

Eureka

Integration

Metrics

(Servo)

Bootstrapping (Governator)

Metrics (Servo)

Admin Console

HTTP

Eureka Integration

Registration

Fetch Registry

Ribbon

Hystrix

EVCache

R

x

N

e

t

t

y

RxNetty

UDP

TCP

WebSockets

SSE

A Completely Reactive Architecture

Page 100: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Details: http://www.meetup.com/Netflix-Open-Source-

Platform/events/184153592/

Page 101: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 102: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

interface

recommendationsByUserId @Var "userId"

@Http(method = HttpMethod.GET, uriTemplate="/users/{userId}/recommendations")

@Hystrix(fallbackHandler = RecommendationFallbackHandler.class)

@EvCache(name = "movie-rec", appName = "movieService", cacheKeyTemplate = "{userId}")

MovieService movieService = Ribbon.from(MovieService.class);

Observable<Recommendations> result =

movieService.recommendationsByUserId(“user1”)

.toObservable();

Page 103: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

NetflixOSS

Page 104: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

NetflixOSS

http://netflix.github.co

Page 105: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

NetflixOSS

• Eureka

• Karyon

• Ribbon

• Hystrix

• Archaius

• Servo

• EVCache

• Curator/Exhibitor

Page 106: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Talk Time Title

PFC-305 Wednesday, 1:15pm Embracing Failure: Fault Injection and Service Reliability

BDT-403 Wednesday, 2:15pm Next Generation Big Data Platform at Netflix

PFC-306 Wednesday, 3:30pm Performance Tuning EC2

DEV-309 Wednesday, 3:30pm From Asgard to Zuul, How Netflix’s proven Open Source

Tools can accelerate and scale your services

ARC-317 Wednesday, 4:30pm Maintaining a Resilient Front-Door at Massive Scale

PFC-304 Wednesday, 4:30pm Effective Inter-process Communications in the Cloud: The

Pros and Cons of Micro Services Architectures

ENT-209 Wednesday, 4:30pm Cloud Migration, Dev-Ops and Distributed Systems

APP-310 Friday, 9:00am Scheduling using Apache Mesos in the Cloud

Page 107: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

• Netflix – background and evolution

• Monolithic Apps

• Microservices

– Challenges and Solutions

– Best Practices

• InterProcess Communication

• Takeaways

Page 108: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 109: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014
Page 110: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

http://techblog.netflix.com

http://netflix.github.io

http://martinfowler.com/articles/microservices.html

http://microservices.io/

Page 111: (PFC304) Effective Interprocess Communications in the Cloud: The Pros and Cons of Microservices Architectures | AWS re:Invent 2014

Please give us your feedback on this session.

Complete session evaluations and earn re:Invent swag.

http://bit.ly/awsevals

Netflix Booth