microservices at netflix
TRANSCRIPT
Application Networks:Microservices at Netflix
May 2016
Uri SaridCTO – MuleSoft
Katharina ProbstEngineering Manager, API – Netflix
To survive and thrive, you need:
3
RobustnessAgilitySpeed
4
And do it all – at scale!
No business is safe from disruption
5
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
But some survive and thrive
7
McDonalds: just a fast-food chain?
a digital restaurant platformfor
innovation and execution agility
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
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
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
11
Microservices
towards microservices
12
The 2 pillars of microservices
APIexcellence
devopsexcellence
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
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
….
System overview
Zuul(gateway)
API
Personali-zation
User info EVCache Ratings A/B
Services interactions (simplified)
1 2
4 5 6 7?
Zuul (gateway) Geo
API
User Info A/B EVCache Recommen-dations
3
Lifecycle of a service
Services scale independently
Services scale up/down with traffic
Changes in traffic patterns don’t affect services equally
Services evolve independently
Independent release cycles
Some services change more frequently than others
Embedding service
EVCacheservice
EVCacheclient lib
Services provide client libraries
Client library as canonical way to interact with service
Service owner defines API
Lifecycle of API service
Daily dependency updates
Daily canaries
Daily pushes:((new code ||
new dependency updates) && canaries pass)
Spinnaker for CI, CD, and more
Spinnaker for CI, CD, and more
Operations: engineers are responsible for:
Code pushes
Metrics, alerts, monitoring
Choosing the right tooling for whatever operational insight you need
Atlas for telemetry
Mantis for real-time analysis
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)
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
Planning for failure in a complex systemZuul API Downstream
services
Testing for different failure conditions
Chaos monkey
Chaos Kong
FIT
Protect against failure: Hystrix
….
API
Personali-zation
User info EVCache Ratings A/B
Hystrix
….
API
Personali-zation
User info EVCache Ratings A/B
Don’t let this happen.
Hystrix
….
API
Personali-zation
User info EVCache Ratings A/B
Instead, don’t send more traffic to unhealthy service.
Hystrix
….
API
Personalization fallback
User info EVCache Ratings A/B
Serve fallbacks instead.
Hystrix
….
API
Personali-zation
User info EVCache Ratings A/B
Return to normal when service is back up.
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?• …
Thank you