Top Banner
How Netflix does Microservices ... Manuel Correa
25
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: How Netflix does Microservices

How Netflix does Microservices ...

Manuel Correa

Page 2: How Netflix does Microservices

Microservices“Small Autonomous Services

that Work Together”Sam Newman

Page 3: How Netflix does Microservices

Microservices“Conway’s Law”

“Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization's communication structure.”

Page 4: How Netflix does Microservices

Microservices Principles

http://www.slideshare.net/spnewman/principles-of-microservices-ndc-2014

Modeled around Business Domain Culture of Automation Hide Implementation

Decentralize All Things

Design for Failure

Highly Observable

Deploy Independently

MicroServices

Page 5: How Netflix does Microservices

Culture of Automation- Immutable infrastructure in

AWS

Page 6: How Netflix does Microservices

Decentralize All ThingsHide Implementation Details

- Routing- Contracts- Resiliancy- Discovery- How services work togetherNodeJS

Ruby

Clojure

Free for all

Agree

Page 7: How Netflix does Microservices

Decentralize All ThingsSmart Endpoints and Dumb Pipes

- Dynamic Routing - Gateway for all Netflix services- Pluggable system that takes care of:

- Authorization and Authentication- Monitoring and tracking request- Load shedding- First level of resilience- Enables caching in the gateway level

Page 8: How Netflix does Microservices

Decentralize All ThingsSmart Endpoints and Dumb Pipes

Page 9: How Netflix does Microservices

Decentralize All thingsService Discovery

- Service Registry- Middle tier load balancing- Carries metadata of each service- Dynamic Service repository

Page 10: How Netflix does Microservices

Decentralize All ThingsDynamic Configuration

- Dynamic Typed Properties = Feature Flag System- Allow you to change properties on Runtime - Polling framework- Multiple sources (i.e.: Cassandra and DynamoDB)- Callbacks when the property changes

CB’s Zuul is using Archaius to change properties across AWS regions, HttpClient configurations and logging level

Page 11: How Netflix does Microservices

Design for Failure

- HTTP library- Load balancing on the client side- Retrys built-in - Caching- Request batching

Page 12: How Netflix does Microservices

Design for Failure

- Java Resilience library- Stop cascading failures- Fallback and gracefully degrade when possible- Realtime monitoring- Circuit breaker pattern

Page 13: How Netflix does Microservices

Design for Failure

● No Service has 100% SLA● 99.9930= 99.7% uptime● 0.3% of 1 billion requests = 300,000 failures● 2+ hours downtime/month even if all

dependencies have excellent uptime.

Service1

Service2

Service3 Fallback

Page 14: How Netflix does Microservices

Design for FailureCircuit Breaker pattern

Page 15: How Netflix does Microservices

Design for FailureHystrix Dashboard

Page 16: How Netflix does Microservices

Decentralized Architecture

Page 17: How Netflix does Microservices

DemoMay the demo Gods be with us...

/service/jobs

Client

/service/resumes

:9292

:9292

Page 18: How Netflix does Microservices

DemoMay the demo Gods be with us...

SERVICEClient Zu

ul

Hys

trix

Rib

bon

Fallback Backup Service

FallbackCache

:9090

:9292

:9393

Page 19: How Netflix does Microservices

Design for Failure

- Testing resiliency in Production- Chaos Monkey => Kill instances randomly- Latency Monkey => Induce latency in services- Chaos Gorilla => Simulates AZ and regions down- Conformity Monkey => Make sure instances follow good

practices

Page 20: How Netflix does Microservices

Highly Observable

- Hystrix Stream aggregator

- AWS Change Tracker

- AWS Usage Tracker

Page 21: How Netflix does Microservices

Take Aways

http://www.slideshare.net/spnewman/principles-of-microservices-ndc-2014

Modeled around Business Domain Culture of Automation Hide Implementation

Decentralize All Things

Design for Failure

Highly Observable

Deploy Independently

MicroServices

Page 22: How Netflix does Microservices

Take Aways- Each Service must have a fallback strategy by

design- Routing layer is essential for the architecture- To make Services work together, there is a

need for a highly reliable infrastructure around the MicroServices

Page 23: How Netflix does Microservices

Take Aways“Conway’s Law”

“Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization's communication structure.”