SlideShare a Scribd company logo
1 of 85
Sudhir Tonse
Manager, Cloud Platform Engineering – Netflix
@stonse
Scalable Microservices at Netflix. Challenges
and Tools of the Trade
Who am I?
• Sudhir Tonse - Manager, Cloud Platform Engineering – Netflix
• Contributed to many NetflixOSS components (Archaius, Ribbon …)
• Been through many production outages 
@stonse
AGENDA
• Netflix – background and evolution
• Monolithic Apps
• Characteristics
• What are Microservices?
• Microservices
• Why?
• Challenges
• Best practices
• Tools of the trade
• InterProcess Communication
• Takeaways
Netflix - Evolution
• Old DataCenter (2008)
• Everything in one WebApp (.war)
• AWS Cloud (~2010)
• 100s of Fine Grained Services
Netflix - Evolution
Netflix Scale
• ~ 1/3 of the peak Internet traffic a day
• ~50M subscribers
• ~2 Billion Edge API Requests/Day
• >500 MicroServices
• ~30 Engineering Teams (owning many microservices)
Monolithic Apps
MONOLITHIC APP
Monolithic Architecture
Load Balancer
Monolithic App
Account
Component
Catalog
Component
Recommendation
Component
Customer Service
Component
Database
Characteristics
• Large Codebase
• Many Components, no clear ownership
• Long deployment cycles
Pros
• Single codebase
• Easy to develop/debug/deploy
• Good IDE support
• Easy to scale horizontally (but can only scale in an “un-differentiated”
manner)
• A Central Ops team can efficiently handle
Monolithic App – Evolution
• As codebase increases …
• Tends to increase “tight coupling” between components
• Just like the cars of a train
• All components have to be coded in the same language
Evolution of a Monolithic App
User Accounts
Shopping Cart
Product Catalog
Customer Service
Monolithic App - Scaling
• Scaling is “undifferentiated”
• Cant scale “Product Catalog” differently from “Customer Service”
AVAILABILITY
Availability
• A single missing “;” brought down the Netflix website for many hours (~2008)
MONOLITHIC APPS – FAILURE & AVAILABILITY
MicroServices
You Think??
TIPPING POINT
& &
Organizational Growth Disverse Functionality Bottleneck in
Monolithic stack
What are
MicroServices?
NOT ABOUT …
• Team size
• Lines of code
• Number of API/EndPoints
MicroService
MegaService
CHARACTERISTICS
• Many smaller (fine grained), clearly scoped services
• Single Responsibility Principle
• Domain Driven Development
• Bounded Context
• Independently Managed
• Clear ownership for each service
• Typically need/adopt the “DevOps” model
Attribution: Adrian Cockroft, Martin Fowler …
Composability– unix philosophy
• 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
MONOLITHIC APP (VARIOUS COMPONENTS LINKED TOGETHER)
Comparing Monolithic to MicroServices
MICROSERVICES – SEPARATE SINGLE PURPOSE SERVICES
Monolithic Architecture (Revisiting)
Load Balancer
Monolithic App
Account
Component
Catalog
Component
Recommendation
Component
Customer Service
Component
Database
Microservices Architecture
Load Balancer
Account Service Catalog
Service
Recommendation
Service
Customer Service
Service
Catalog
DB
API Gateway
Customer
DB
Concept -> Service Dependency Graph
Your App/Service
Service X
Service Y
Service Z
Service L
Service M
MicroServices
- Why?
WHY?
• Faster and simpler deployments and rollbacks
• Independent Speed of Delivery (by different teams)
• Right framework/tool/language for each domain
• Recommendation component using Python?, Catalog Service in Java ..
• Greater Resiliency
• Fault Isolation
• Better Availability
• If architected right 
MicroServices
- Challenges
CHALLENGES
Can lead to chaos if not designed right …
OVERALL COMPLEXITY
• Distributed Systems are inherently Complex
• N/W Latency, Fault Tolerance, Retry storms ..
• Operational Overhead
• TIP: Embrace DevOps Model
SERVICE DISCOVERY
• 100s of MicroServices
• Need a Service Metadata Registry (Discovery Service)
Account Service Catalog
Service
Recommendation
Service
Customer Service
Service
X
Service Y
Service
Z
Service
Registry
Service
(e.g. Netflix Eureka)
CHATTINESS (AND FAN OUT)
~2 Billion Requests per day on Edge Service
Results in ~20 Billion Fan out requests in ~100 MicroServices
1 Request 1 Request
Monolithic App MicroServices
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
X
Avro
X
Xml
JSON
CHALLENGES - SUMMARY
• Service Discovery
• Operational Overhead (100s of services; DevOps model absolutely required)
• Distributed Systems are inherently Complex
• N/W Latency, Fault Tolerance, Serialization overhead ..
• Service Interface Versioning, Mismatches?
• Testing (Need the entire ecosystem to test)
• Fan out of Requests -> Increases n/w traffic
Best Practices/Tips
Best Practice -> Isolation/Access
• TIP: In AWS, use Security Groups to isolate/restrict access to your MicroServices
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html
Best Practice -> Loadbalancers
Choice
1. Central Loadbalancer? (H/W or S/W)
OR
2. Client based S/W Loadbalancer?
Central (Proxy) Loadbalancer
Account Service Load
Balancer
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
Client Loadbalancer
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
Client based Smart Loadbalancer
Use Ribbon (http://github.com/netflix/ribbon)
Best Practice -> LoadBalancers
• TIP: Use Client Side Smart LoadBalancers
BEST PRACTICES CONTD..
• Dependency Calls
• Guard your dependency calls
• Cache your dependency call results
• Consider Batching your dependency calls
• Increase throughput via Async/ReactiveX patterns
Dependency Resiliency
Service Hosed!!
A single “bad” service can still bring your service down
AVAILABILITY
MicroServices does not automatically mean better Availability
- Unless you have Fault Tolerant Architecture
Resiliency/Availability
HANDLING FAN OUTS
SERVER CACHING
Your App/Service
Service X
Service Y
Service Z
Cache
Cluster
Cache
Cluster
Tip: Config your TTL based on flexibility with data staleness!
Composite (Materialized View) Caching
Your App/Service
Service X
Service Y
Service Z
Cache
Cluster
Fn {A, B, C}
Cache
Cluster
BottleNecks/HotSpots
A/B Test Service
User Account
Service
Service X Service Y Service Z
App
Tip: Pass data via Headers
A/B Test Service
User Account
Service
Service X Service Y Service Z
App
reduces dependency
load
TEST RESILIENCY (of Overall MicroServices)
* Benjamin Franklin
* Inspired by Benjamin Franklin
three
Best Practices contd..
• Test Services for Resiliency
• Latency/Error tests (via Simian Army)
• Dependency Service Unavailability
• Network Errors
Test Resiliency – to dependencies
TEST RESILIENCY
Use Simian Army https://github.com/Netflix/SimianArmy
BEST PRACTICES - SUMMARY
• Isolate your services (Loosely Coupled)
• Use Client Side Smart LoadBalancers
• Dependency Calls
• Guard your dependency calls
• Cache your dependency call results
• Consider Batching your dependency calls
• Increase throughput via Async/ReactiveX patterns
• Test Services for Resiliency
• Latency/Error tests (via Simian Army)
• Dependency Service Unavailability
• Network Errors
Tools of the Trade
AUTO SCALING
• Use AWS Auto Scaling Groups to automatically scale your microservices
• RPS or CPU/LoadAverage via CloudWatch are typical metrics used to scale
http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/WhatIsAutoScaling.html
USE CANARY, RED/BLACK PUSHES
• NetflixOSS Asgard helps manage deployments
Service Dependency Visualization
MicroServices at Netflix
SERVICE DEPENDENCY GRAPH
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?
SERVICE DEPENDENCY VISUALIZATION
You
Your Service Dependency Graph
Service Dependency Visualization
Dependency Visualization
Polyglot Ecosystem
Homogeneity in A Polyglot Ecosystem
TIP: USE A SIDECAR
• Provides a common
homogenous
Operational/Infrastructural
component for all your non-
JVM
based MicroServices
Prana Open Sourced!
• Just this morning!
• http://github.com/netflix/Prana
Inter Process
Communication
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 Console
HTTP
Eureka Integration
Registration
Fetch Registry
A Blocking Architecture
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
Performance – Throughput
Details: http://www.meetup.com/Netflix-Open-Source-Platform/events/184153592/
NetflixOSS
LEVERAGE NETFLIXOSS
http://netflix.github.co
• Eureka – for Service Registry/Discovery
• Karyon – for Server (Reactive or threaded/servlet container based)
• Ribbon – for IPC Client
• And Fault Tolerant Smart LoadBalancer
• Hystrix – for Fault Tolerance and Resiliency
• Archaius – for distributed/dynamic Properties
• Servo – unified Feature rich Metrics/Insight
• EVCache – for distributed cache
• Curator/Exhibitor – for zookeeper based operations
• …
Takeaways
Takeaways
• Monolithic apps – good for small organizations
• MicroServices – have its challenges, but the benefits are many
• Consider adopting when your organization scales
• Leverage Best Practices
• An Elastic Cloud provides the ideal environment (Auto Scaling etc.)
• NetflixOSS has many libraries/samples to aid you
Questions?
@stonse

More Related Content

Similar to QConSF-MicroServices-IPC-Netflix-Sudhir-2014.pptx

.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric.NET microservices with Azure Service Fabric
.NET microservices with Azure Service FabricDavide Benvegnù
 
AWS Innovate: Smaller IS Better – Exploiting Microservices on AWS, Craig Dickson
AWS Innovate: Smaller IS Better – Exploiting Microservices on AWS, Craig DicksonAWS Innovate: Smaller IS Better – Exploiting Microservices on AWS, Craig Dickson
AWS Innovate: Smaller IS Better – Exploiting Microservices on AWS, Craig DicksonAmazon Web Services Korea
 
Concurrency at Scale: Evolution to Micro-Services
Concurrency at Scale:  Evolution to Micro-ServicesConcurrency at Scale:  Evolution to Micro-Services
Concurrency at Scale: Evolution to Micro-ServicesRandy Shoup
 
Cloud Computing & Business Intelligence
Cloud Computing & Business IntelligenceCloud Computing & Business Intelligence
Cloud Computing & Business IntelligenceSudip Chatterjee
 
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Introducing to serverless computing and AWS lambda - Israel Clouds MeetupIntroducing to serverless computing and AWS lambda - Israel Clouds Meetup
Introducing to serverless computing and AWS lambda - Israel Clouds MeetupBoaz Ziniman
 
AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)
AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)
AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)Amazon Web Services
 
Microservices Architecture, Monolith Migration Patterns
Microservices Architecture, Monolith Migration PatternsMicroservices Architecture, Monolith Migration Patterns
Microservices Architecture, Monolith Migration PatternsAraf Karsh Hamid
 
Designing Microservices
Designing MicroservicesDesigning Microservices
Designing MicroservicesDavid Chou
 
Micro service session 1
Micro service   session 1Micro service   session 1
Micro service session 1Amin Arab
 
Service Fabric – building tomorrows applications today
Service Fabric – building tomorrows applications todayService Fabric – building tomorrows applications today
Service Fabric – building tomorrows applications todayBizTalk360
 
AWS Summit Auckland - Smaller is Better - Microservices on AWS
AWS Summit Auckland - Smaller is Better - Microservices on AWSAWS Summit Auckland - Smaller is Better - Microservices on AWS
AWS Summit Auckland - Smaller is Better - Microservices on AWSAmazon Web Services
 
Introduction to AWS
Introduction to AWSIntroduction to AWS
Introduction to AWSOSSCube
 
Come costruire apllicazioni "12-factor microservices" in AWS
Come costruire apllicazioni "12-factor microservices" in AWSCome costruire apllicazioni "12-factor microservices" in AWS
Come costruire apllicazioni "12-factor microservices" in AWSAmazon Web Services
 
Testing the Migration of Monolithic Applications to Microservices on the Cloud
Testing the Migration of Monolithic Applications to Microservices on the CloudTesting the Migration of Monolithic Applications to Microservices on the Cloud
Testing the Migration of Monolithic Applications to Microservices on the CloudNagarro
 
Evolving your Architecture to MicroServices
Evolving your Architecture to MicroServicesEvolving your Architecture to MicroServices
Evolving your Architecture to MicroServicesHector Tapia
 
Netflix0SS Services on Docker
Netflix0SS Services on DockerNetflix0SS Services on Docker
Netflix0SS Services on DockerDocker, Inc.
 
Ibm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinalIbm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinalaspyker
 
Microservices and docker
Microservices and dockerMicroservices and docker
Microservices and dockerAlex Ivy
 
Netflix Cloud Platform and Open Source
Netflix Cloud Platform and Open SourceNetflix Cloud Platform and Open Source
Netflix Cloud Platform and Open Sourceaspyker
 
Transforming Legacy Applications Into Dynamically Scalable Web Services
Transforming Legacy Applications Into Dynamically Scalable Web ServicesTransforming Legacy Applications Into Dynamically Scalable Web Services
Transforming Legacy Applications Into Dynamically Scalable Web ServicesAdam Takvam
 

Similar to QConSF-MicroServices-IPC-Netflix-Sudhir-2014.pptx (20)

.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric
 
AWS Innovate: Smaller IS Better – Exploiting Microservices on AWS, Craig Dickson
AWS Innovate: Smaller IS Better – Exploiting Microservices on AWS, Craig DicksonAWS Innovate: Smaller IS Better – Exploiting Microservices on AWS, Craig Dickson
AWS Innovate: Smaller IS Better – Exploiting Microservices on AWS, Craig Dickson
 
Concurrency at Scale: Evolution to Micro-Services
Concurrency at Scale:  Evolution to Micro-ServicesConcurrency at Scale:  Evolution to Micro-Services
Concurrency at Scale: Evolution to Micro-Services
 
Cloud Computing & Business Intelligence
Cloud Computing & Business IntelligenceCloud Computing & Business Intelligence
Cloud Computing & Business Intelligence
 
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Introducing to serverless computing and AWS lambda - Israel Clouds MeetupIntroducing to serverless computing and AWS lambda - Israel Clouds Meetup
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
 
AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)
AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)
AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)
 
Microservices Architecture, Monolith Migration Patterns
Microservices Architecture, Monolith Migration PatternsMicroservices Architecture, Monolith Migration Patterns
Microservices Architecture, Monolith Migration Patterns
 
Designing Microservices
Designing MicroservicesDesigning Microservices
Designing Microservices
 
Micro service session 1
Micro service   session 1Micro service   session 1
Micro service session 1
 
Service Fabric – building tomorrows applications today
Service Fabric – building tomorrows applications todayService Fabric – building tomorrows applications today
Service Fabric – building tomorrows applications today
 
AWS Summit Auckland - Smaller is Better - Microservices on AWS
AWS Summit Auckland - Smaller is Better - Microservices on AWSAWS Summit Auckland - Smaller is Better - Microservices on AWS
AWS Summit Auckland - Smaller is Better - Microservices on AWS
 
Introduction to AWS
Introduction to AWSIntroduction to AWS
Introduction to AWS
 
Come costruire apllicazioni "12-factor microservices" in AWS
Come costruire apllicazioni "12-factor microservices" in AWSCome costruire apllicazioni "12-factor microservices" in AWS
Come costruire apllicazioni "12-factor microservices" in AWS
 
Testing the Migration of Monolithic Applications to Microservices on the Cloud
Testing the Migration of Monolithic Applications to Microservices on the CloudTesting the Migration of Monolithic Applications to Microservices on the Cloud
Testing the Migration of Monolithic Applications to Microservices on the Cloud
 
Evolving your Architecture to MicroServices
Evolving your Architecture to MicroServicesEvolving your Architecture to MicroServices
Evolving your Architecture to MicroServices
 
Netflix0SS Services on Docker
Netflix0SS Services on DockerNetflix0SS Services on Docker
Netflix0SS Services on Docker
 
Ibm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinalIbm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinal
 
Microservices and docker
Microservices and dockerMicroservices and docker
Microservices and docker
 
Netflix Cloud Platform and Open Source
Netflix Cloud Platform and Open SourceNetflix Cloud Platform and Open Source
Netflix Cloud Platform and Open Source
 
Transforming Legacy Applications Into Dynamically Scalable Web Services
Transforming Legacy Applications Into Dynamically Scalable Web ServicesTransforming Legacy Applications Into Dynamically Scalable Web Services
Transforming Legacy Applications Into Dynamically Scalable Web Services
 

Recently uploaded

WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!WSO2
 
WSO2CON 2024 - Lessons from the Field: Legacy Platforms – It's Time to Let Go...
WSO2CON 2024 - Lessons from the Field: Legacy Platforms – It's Time to Let Go...WSO2CON 2024 - Lessons from the Field: Legacy Platforms – It's Time to Let Go...
WSO2CON 2024 - Lessons from the Field: Legacy Platforms – It's Time to Let Go...WSO2
 
Driving Innovation: Scania's API Revolution with WSO2
Driving Innovation: Scania's API Revolution with WSO2Driving Innovation: Scania's API Revolution with WSO2
Driving Innovation: Scania's API Revolution with WSO2WSO2
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
WSO2Con2024 - Unleashing the Financial Potential of 13 Million People
WSO2Con2024 - Unleashing the Financial Potential of 13 Million PeopleWSO2Con2024 - Unleashing the Financial Potential of 13 Million People
WSO2Con2024 - Unleashing the Financial Potential of 13 Million PeopleWSO2
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...WSO2
 
WSO2CON 2024 - Architecting AI in the Enterprise: APIs and Applications
WSO2CON 2024 - Architecting AI in the Enterprise: APIs and ApplicationsWSO2CON 2024 - Architecting AI in the Enterprise: APIs and Applications
WSO2CON 2024 - Architecting AI in the Enterprise: APIs and ApplicationsWSO2
 
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2
 
WSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital BusinessesWSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital BusinessesWSO2
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2
 
WSO2CON 2024 - Building a Digital Government in Uganda
WSO2CON 2024 - Building a Digital Government in UgandaWSO2CON 2024 - Building a Digital Government in Uganda
WSO2CON 2024 - Building a Digital Government in UgandaWSO2
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...WSO2
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2
 

Recently uploaded (20)

WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
 
WSO2CON 2024 - Lessons from the Field: Legacy Platforms – It's Time to Let Go...
WSO2CON 2024 - Lessons from the Field: Legacy Platforms – It's Time to Let Go...WSO2CON 2024 - Lessons from the Field: Legacy Platforms – It's Time to Let Go...
WSO2CON 2024 - Lessons from the Field: Legacy Platforms – It's Time to Let Go...
 
Driving Innovation: Scania's API Revolution with WSO2
Driving Innovation: Scania's API Revolution with WSO2Driving Innovation: Scania's API Revolution with WSO2
Driving Innovation: Scania's API Revolution with WSO2
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2Con2024 - Unleashing the Financial Potential of 13 Million People
WSO2Con2024 - Unleashing the Financial Potential of 13 Million PeopleWSO2Con2024 - Unleashing the Financial Potential of 13 Million People
WSO2Con2024 - Unleashing the Financial Potential of 13 Million People
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
 
WSO2CON 2024 - Architecting AI in the Enterprise: APIs and Applications
WSO2CON 2024 - Architecting AI in the Enterprise: APIs and ApplicationsWSO2CON 2024 - Architecting AI in the Enterprise: APIs and Applications
WSO2CON 2024 - Architecting AI in the Enterprise: APIs and Applications
 
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
 
WSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital BusinessesWSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital Businesses
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
WSO2CON 2024 - Building a Digital Government in Uganda
WSO2CON 2024 - Building a Digital Government in UgandaWSO2CON 2024 - Building a Digital Government in Uganda
WSO2CON 2024 - Building a Digital Government in Uganda
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 

QConSF-MicroServices-IPC-Netflix-Sudhir-2014.pptx

  • 1. Sudhir Tonse Manager, Cloud Platform Engineering – Netflix @stonse Scalable Microservices at Netflix. Challenges and Tools of the Trade
  • 2. Who am I? • Sudhir Tonse - Manager, Cloud Platform Engineering – Netflix • Contributed to many NetflixOSS components (Archaius, Ribbon …) • Been through many production outages  @stonse
  • 3. AGENDA • Netflix – background and evolution • Monolithic Apps • Characteristics • What are Microservices? • Microservices • Why? • Challenges • Best practices • Tools of the trade • InterProcess Communication • Takeaways
  • 5. • Old DataCenter (2008) • Everything in one WebApp (.war) • AWS Cloud (~2010) • 100s of Fine Grained Services Netflix - Evolution
  • 6. Netflix Scale • ~ 1/3 of the peak Internet traffic a day • ~50M subscribers • ~2 Billion Edge API Requests/Day • >500 MicroServices • ~30 Engineering Teams (owning many microservices)
  • 9. Monolithic Architecture Load Balancer Monolithic App Account Component Catalog Component Recommendation Component Customer Service Component Database
  • 10. Characteristics • Large Codebase • Many Components, no clear ownership • Long deployment cycles
  • 11. Pros • Single codebase • Easy to develop/debug/deploy • Good IDE support • Easy to scale horizontally (but can only scale in an “un-differentiated” manner) • A Central Ops team can efficiently handle
  • 12. Monolithic App – Evolution • As codebase increases … • Tends to increase “tight coupling” between components • Just like the cars of a train • All components have to be coded in the same language
  • 13.
  • 14. Evolution of a Monolithic App User Accounts Shopping Cart Product Catalog Customer Service
  • 15. Monolithic App - Scaling • Scaling is “undifferentiated” • Cant scale “Product Catalog” differently from “Customer Service”
  • 17. Availability • A single missing “;” brought down the Netflix website for many hours (~2008)
  • 18. MONOLITHIC APPS – FAILURE & AVAILABILITY
  • 20. TIPPING POINT & & Organizational Growth Disverse Functionality Bottleneck in Monolithic stack
  • 22. NOT ABOUT … • Team size • Lines of code • Number of API/EndPoints MicroService MegaService
  • 23. CHARACTERISTICS • Many smaller (fine grained), clearly scoped services • Single Responsibility Principle • Domain Driven Development • Bounded Context • Independently Managed • Clear ownership for each service • Typically need/adopt the “DevOps” model Attribution: Adrian Cockroft, Martin Fowler …
  • 24. Composability– unix philosophy • 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
  • 25. MONOLITHIC APP (VARIOUS COMPONENTS LINKED TOGETHER) Comparing Monolithic to MicroServices
  • 26. MICROSERVICES – SEPARATE SINGLE PURPOSE SERVICES
  • 27. Monolithic Architecture (Revisiting) Load Balancer Monolithic App Account Component Catalog Component Recommendation Component Customer Service Component Database
  • 28. Microservices Architecture Load Balancer Account Service Catalog Service Recommendation Service Customer Service Service Catalog DB API Gateway Customer DB
  • 29. Concept -> Service Dependency Graph Your App/Service Service X Service Y Service Z Service L Service M
  • 31. WHY? • Faster and simpler deployments and rollbacks • Independent Speed of Delivery (by different teams) • Right framework/tool/language for each domain • Recommendation component using Python?, Catalog Service in Java .. • Greater Resiliency • Fault Isolation • Better Availability • If architected right 
  • 33. CHALLENGES Can lead to chaos if not designed right …
  • 34. OVERALL COMPLEXITY • Distributed Systems are inherently Complex • N/W Latency, Fault Tolerance, Retry storms .. • Operational Overhead • TIP: Embrace DevOps Model
  • 35. SERVICE DISCOVERY • 100s of MicroServices • Need a Service Metadata Registry (Discovery Service) Account Service Catalog Service Recommendation Service Customer Service Service X Service Y Service Z Service Registry Service (e.g. Netflix Eureka)
  • 36. CHATTINESS (AND FAN OUT) ~2 Billion Requests per day on Edge Service Results in ~20 Billion Fan out requests in ~100 MicroServices 1 Request 1 Request Monolithic App MicroServices
  • 37. 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 X Avro X Xml JSON
  • 38. CHALLENGES - SUMMARY • Service Discovery • Operational Overhead (100s of services; DevOps model absolutely required) • Distributed Systems are inherently Complex • N/W Latency, Fault Tolerance, Serialization overhead .. • Service Interface Versioning, Mismatches? • Testing (Need the entire ecosystem to test) • Fan out of Requests -> Increases n/w traffic
  • 40. Best Practice -> Isolation/Access • TIP: In AWS, use Security Groups to isolate/restrict access to your MicroServices http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html
  • 41. Best Practice -> Loadbalancers Choice 1. Central Loadbalancer? (H/W or S/W) OR 2. Client based S/W Loadbalancer?
  • 42. Central (Proxy) Loadbalancer Account Service Load Balancer 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
  • 43. Client Loadbalancer 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
  • 44. Client based Smart Loadbalancer Use Ribbon (http://github.com/netflix/ribbon)
  • 45. Best Practice -> LoadBalancers • TIP: Use Client Side Smart LoadBalancers
  • 46. BEST PRACTICES CONTD.. • Dependency Calls • Guard your dependency calls • Cache your dependency call results • Consider Batching your dependency calls • Increase throughput via Async/ReactiveX patterns
  • 48. Service Hosed!! A single “bad” service can still bring your service down
  • 49. AVAILABILITY MicroServices does not automatically mean better Availability - Unless you have Fault Tolerant Architecture
  • 52. SERVER CACHING Your App/Service Service X Service Y Service Z Cache Cluster Cache Cluster Tip: Config your TTL based on flexibility with data staleness!
  • 53. Composite (Materialized View) Caching Your App/Service Service X Service Y Service Z Cache Cluster Fn {A, B, C} Cache Cluster
  • 54. BottleNecks/HotSpots A/B Test Service User Account Service Service X Service Y Service Z App
  • 55. Tip: Pass data via Headers A/B Test Service User Account Service Service X Service Y Service Z App reduces dependency load
  • 56. TEST RESILIENCY (of Overall MicroServices)
  • 58. * Inspired by Benjamin Franklin three
  • 59. Best Practices contd.. • Test Services for Resiliency • Latency/Error tests (via Simian Army) • Dependency Service Unavailability • Network Errors
  • 60. Test Resiliency – to dependencies
  • 61. TEST RESILIENCY Use Simian Army https://github.com/Netflix/SimianArmy
  • 62. BEST PRACTICES - SUMMARY • Isolate your services (Loosely Coupled) • Use Client Side Smart LoadBalancers • Dependency Calls • Guard your dependency calls • Cache your dependency call results • Consider Batching your dependency calls • Increase throughput via Async/ReactiveX patterns • Test Services for Resiliency • Latency/Error tests (via Simian Army) • Dependency Service Unavailability • Network Errors
  • 63. Tools of the Trade
  • 64. AUTO SCALING • Use AWS Auto Scaling Groups to automatically scale your microservices • RPS or CPU/LoadAverage via CloudWatch are typical metrics used to scale http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/WhatIsAutoScaling.html
  • 65. USE CANARY, RED/BLACK PUSHES • NetflixOSS Asgard helps manage deployments
  • 68. SERVICE DEPENDENCY GRAPH 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?
  • 69. SERVICE DEPENDENCY VISUALIZATION You Your Service Dependency Graph
  • 73. Homogeneity in A Polyglot Ecosystem
  • 74. TIP: USE A SIDECAR • Provides a common homogenous Operational/Infrastructural component for all your non- JVM based MicroServices
  • 75. Prana Open Sourced! • Just this morning! • http://github.com/netflix/Prana
  • 77. 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 Console HTTP Eureka Integration Registration Fetch Registry A Blocking Architecture
  • 78. 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
  • 79. Performance – Throughput Details: http://www.meetup.com/Netflix-Open-Source-Platform/events/184153592/
  • 82. • Eureka – for Service Registry/Discovery • Karyon – for Server (Reactive or threaded/servlet container based) • Ribbon – for IPC Client • And Fault Tolerant Smart LoadBalancer • Hystrix – for Fault Tolerance and Resiliency • Archaius – for distributed/dynamic Properties • Servo – unified Feature rich Metrics/Insight • EVCache – for distributed cache • Curator/Exhibitor – for zookeeper based operations • …
  • 84. Takeaways • Monolithic apps – good for small organizations • MicroServices – have its challenges, but the benefits are many • Consider adopting when your organization scales • Leverage Best Practices • An Elastic Cloud provides the ideal environment (Auto Scaling etc.) • NetflixOSS has many libraries/samples to aid you

Editor's Notes

  1. Startup dependencies hurt us on scale up event Degrading without knowing is bad