application networks: microservices and apis at netflix

37
Application Networks: Microservices at Netflix May 2016

Upload: mulesoft

Post on 22-Jan-2017

3.204 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Application Networks: Microservices and APIs at Netflix

Application Networks:Microservices at Netflix

May 2016

Page 2: Application Networks: Microservices and APIs at Netflix

Uri SaridCTO – MuleSoft

Katharina ProbstEngineering Manager, API – Netflix

Page 3: Application Networks: Microservices and APIs at Netflix

To survive and thrive, you need:

3

RobustnessAgilitySpeed

Page 4: Application Networks: Microservices and APIs at Netflix

4

And do it all – at scale!

Page 5: Application Networks: Microservices and APIs at Netflix

No business is safe from disruption

5

Page 6: Application Networks: Microservices and APIs at Netflix

No business is safe from disruption

6

“52% of the Fortune 500 have been merged, acquired, gone bankrupt or fallen off the list since 2000.”– R. Ray Wang, Principal Analyst, Constellation Research

Page 7: Application Networks: Microservices and APIs at Netflix

But some survive and thrive

7

McDonalds: just a fast-food chain?

a digital restaurant platformfor

innovation and execution agility

Page 8: Application Networks: Microservices and APIs at Netflix

What are they doing right?

8

on what: better apparel? price and selection?

Under Armour is

“building the biggest connected fitness platform in the world”

competes with

Page 9: Application Networks: Microservices and APIs at Netflix

They are composable, built for change

9

an immersive content platform

automotive software innovation platform

parcels and logistics API-first business

retail enterprise data fabricnetwork as a service

Page 10: Application Networks: Microservices and APIs at Netflix

Remember why an application network

10

A seamless network of applications that…

… is organized around focused, well-defined units of value

… is recomposable

… emerges bottoms-up via self-service

… where visibility, security and govern-ability are built in

… where connectivity and reuse are top-level concerns

… bends, not breaks

… where each node adds value to the whole network

… where the business regains control of its future

small services

evolving independently, as fast as needed

coupled just enough to create business value

optimized for change

Page 11: Application Networks: Microservices and APIs at Netflix

11

Microservices

towards microservices

Page 12: Application Networks: Microservices and APIs at Netflix

12

The 2 pillars of microservices

APIexcellence

devopsexcellence

Page 13: Application Networks: Microservices and APIs at Netflix

The 2 pillars of microservices

• API excellence- Define atomic service boundaries- Design for purpose – know service commitment- Dependencies well-defined and managed- API lifecycle

• Devops excellence- Standardize containers and meta-services (services for your

services)- Automate promotion, testing, provisioning, deployment,

security, …- Design for resilience and operatability

13

Page 14: Application Networks: Microservices and APIs at Netflix

Services at Netflix

Self-contained functionality exposes an API

Always owned by a team

Many teams own more than one service

Operated by owner team

Self-contained functionality exposes an API

Always owned by a team

Many teams own more than one service

Operated by owner team

Page 15: Application Networks: Microservices and APIs at Netflix

….

System overview

Zuul(gateway)

API

Personali-zation

User info EVCache Ratings A/B

Page 16: Application Networks: Microservices and APIs at Netflix

Services interactions (simplified)

1 2

4 5 6 7?

Zuul (gateway) Geo

API

User Info A/B EVCache Recommen-dations

3

Page 17: Application Networks: Microservices and APIs at Netflix

Lifecycle of a service

Page 18: Application Networks: Microservices and APIs at Netflix

Services scale independently

Services scale up/down with traffic

Changes in traffic patterns don’t affect services equally

Page 19: Application Networks: Microservices and APIs at Netflix

Services evolve independently

Independent release cycles

Some services change more frequently than others

Page 20: Application Networks: Microservices and APIs at Netflix

Embedding service

EVCacheservice

EVCacheclient lib

Services provide client libraries

Client library as canonical way to interact with service

Service owner defines API

Page 21: Application Networks: Microservices and APIs at Netflix

Lifecycle of API service

Daily dependency updates

Daily canaries

Daily pushes:((new code ||

new dependency updates) && canaries pass)

Page 22: Application Networks: Microservices and APIs at Netflix

Spinnaker for CI, CD, and more

Page 23: Application Networks: Microservices and APIs at Netflix

Spinnaker for CI, CD, and more

Page 24: Application Networks: Microservices and APIs at Netflix

Operations: engineers are responsible for:

Code pushes

Metrics, alerts, monitoring

Choosing the right tooling for whatever operational insight you need

Page 27: Application Networks: Microservices and APIs at Netflix

How to create a new service - paved path

Teams want to build business logic, not an RPC mechanismA central team can provide a paved path (template)

Page 28: Application Networks: Microservices and APIs at Netflix

28

Lessons from microservices at scale

Smart enablement:• Templatize services

• Templatize process

• Reuse: patterns

• Reuse: services

• Provide expertise

Smart operations:• Automated++

• Fail fast & learn

• Design for failure

• Disrupt yourself

• Bend vs break

Smart containers:• Built-in governance

• Built-in meta-svcs

• Setup for SDLC

• Fungible

• Understood by ops

Page 29: Application Networks: Microservices and APIs at Netflix

Planning for failure in a complex systemZuul API Downstream

services

Page 31: Application Networks: Microservices and APIs at Netflix

Protect against failure: Hystrix

….

API

Personali-zation

User info EVCache Ratings A/B

Page 32: Application Networks: Microservices and APIs at Netflix

Hystrix

….

API

Personali-zation

User info EVCache Ratings A/B

Don’t let this happen.

Page 33: Application Networks: Microservices and APIs at Netflix

Hystrix

….

API

Personali-zation

User info EVCache Ratings A/B

Instead, don’t send more traffic to unhealthy service.

Page 34: Application Networks: Microservices and APIs at Netflix

Hystrix

….

API

Personalization fallback

User info EVCache Ratings A/B

Serve fallbacks instead.

Page 35: Application Networks: Microservices and APIs at Netflix

Hystrix

….

API

Personali-zation

User info EVCache Ratings A/B

Return to normal when service is back up.

Page 36: Application Networks: Microservices and APIs at Netflix

36

Microservices for you?

APIexcellence

devopsexcellence

an immersive content platform

• SDLC• Connectivity• Bridges• Paved path• Automation• Tools for failure,

compensation, visibility, and recovery

• …

• Culture & mindset• Training• Devops• Buy-in from bottom• Buy-in from top• Bridges• Team ownership –

to what degree?• …

Page 37: Application Networks: Microservices and APIs at Netflix

Thank you