NetflixOSS - A Cloud Native Architecture - Slides PDF
NetflixOSS - A Cloud Native Architecture - Slides PDF
Architecture
• Tutorial
– Time to explore in and around the subject
– Tutor gets to know the audience
– Discussion, rat-holes, “bring out your dead”
Attendee Introductions
• Who are you, where do you work
• Why are you here today, what do you need
• “Bring out your dead”
– Do you have a specific problem or question?
– One sentence elevator pitch
• What instrument do you play?
Content
Why Public Cloud?
Migration Path
Service and API Architectures
Storage Architecture
Operations and Tools
Example Applications
More?
Cloud Native
A new engineering challenge
Construct a highly agile and highly
available service from ephemeral and
assumed broken components
How to get to Cloud Native
VP Product VP UI VP Discovery
VP Platform
Management Engineering Engineering
Autoscale Up
Autoscale Down
Netflix Member Web Site Home Page
Personalization Driven – How Does It Work?
How Netflix Used to Work
Consumer
Electronics Oracle
Monolithic Web
AWS Cloud App
Services
MySQL
CDN Edge
Locations
Oracle
Datacenter
Customer Device Monolithic
(PC, PS3, TV…) Streaming App
MySQL
Content
Management
Limelight/Level 3
Akamai CDNs
Content Encoding
How Netflix Streaming Works Today
Consumer
Electronics User Data
Web Site or
AWS Cloud Discovery API
Services
Personalization
CDN Edge
Locations
DRM
Datacenter
Customer Device
Streaming API
(PC, PS3, TV…)
QoS Logging
CDN
Management
and Steering
OpenConnect
CDN Boxes
Content Encoding
The AWS Question
March
2013
Mean
Bandwidth
+39% 6mo
The Google Cloud Question
Grey
Public Private
Area
Gigabits Terabits
Akamai Netflix
AWS CloudFront Limelight Openconnect
Level 3 YouTube
What Changed?
Is it running yet?
How many places is it running in?
How far apart are those places?
Netflix Outages
• Running very fast with scissors
– Mostly self inflicted – bugs, mistakes from pace of change
– Some caused by AWS bugs and mistakes
Each icon is
three to a few
hundred
instances
across three Cassandra
AWS zones
memcached
Web service
Start Here
S3 bucket
Load Balancers
Cassandra Replicas Cassandra Replicas Cassandra Replicas Cassandra Replicas Cassandra Replicas Cassandra Replicas
More?
Highly Available NoSQL Storage
Monitoring
appagent
monitoring
Tomcat
Log rotation Application war file, base Healthcheck, status
to S3 GC and thread servlet, platform, client servlets, JMX interface,
AppDynamics dump logging interface jars, Astyanax Servo autoscale
machineagent
Epic/Atlas
Cassandra Instance Architecture
Tomcat and
Priam on JDK Java (JDK 7)
Healthcheck,
Status
AppDynamics
appagent
monitoring
Cassandra Server
Monitoring
AppDynamics Local Ephemeral Disk Space – 2TB of SSD or 1.6TB disk
GC and thread holding Commit log and SSTables
machineagent dump logging
Epic/Atlas
Cassandra at Scale
More?
Scalability from 48 to 288 nodes on AWS
http://techblog.netflix.com/2011/11/benchmarking-cassandra-scalability-on.html
800000
Used 288 of m1.xlarge
4 CPU, 15 GB RAM, 8 ECU
600000
537172 Cassandra 0.86
Benchmark config only
400000 366828 existed for about 1hr
200000 174373
0
0 50 100 150 200 250 300 350
Cassandra Disk vs. SSD Benchmark
Same Throughput, Lower Latency, Half Cost
http://techblog.netflix.com/2012/07/benchmarking-high-performance-io-with.html
2013 - Cross Region Use Cases
• Geographic Isolation
– US to Europe replication of subscriber data
– Read intensive, low update rate
– Production use since late 2011
Validation
Test 1 Million reads Test
Load
Load 1 Million writes Load
After 500ms
CL.ONE (wait for
CL.ONE with no
one replica to ack)
Data loss
Cassandra Replicas Cassandra Replicas Cassandra Replicas Cassandra Replicas Cassandra Replicas Cassandra Replicas
AWS DynECT
Route53 Denominator
UltraDNS DNS
Cassandra Replicas Cassandra Replicas Cassandra Replicas Cassandra Replicas Cassandra Replicas Cassandra Replicas
Denominator – manage traffic via multiple DNS providers with Java code
2013 Timeline - Concept Jan, Code Feb, OSS March, Production use May
Incidents – Impact and Mitigation
Public Relations Y incidents mitigated by Active
Media Impact Active, game day practicing
PR
X Incidents YY incidents
High Customer mitigated by
Service Calls better tools and
CS
practices
XX Incidents
Affects AB YYY incidents
Test Results mitigated by better
Metrics impact – Feature disable
data tagging
XXX Incidents
From C* Aegisthus
Terabytes of
Dimension
data
Data Pipelines
Gateways
Data Warehouse
Over 2 Petabytes
More?
1300 nodes 800 nodes Multiple 150 nodes Nightly
Cloud Native Development
Patterns
Master copies of data are cloud resident
Dynamically provisioned micro-services
Services are distributed and ephemeral
Datacenter to Cloud Transition Goals
• Faster
– Lower latency than the equivalent datacenter web pages and API calls
– Measured as mean and 99th percentile
– For both first hit (e.g. home page) and in-session hits for the same user
• Scalable
– Avoid needing any more datacenter capacity as subscriber count increases
– No central vertically scaled databases
– Leverage AWS elastic capacity effectively
• Available
– Substantially higher robustness and availability than datacenter services
– Leverage multiple AWS availability zones
– No scheduled down time, no central database schema to change
• Productive
– Optimize agility of a large development team with automation and tools
– Leave behind complex tangled datacenter code base (~8 year old architecture)
– Enforce clean layered interfaces and re-usable components
Datacenter Anti-Patterns
More?
Tangled Service Interfaces
• Datacenter implementation is exposed
– Oracle SQL queries mixed into business logic
• Tangled code
– Deep dependencies, false sharing
More?
NetflixOSS Details
• Platform entities and services
• Key Management
– AWS Keys dynamically provisioned, easy updates
– High grade app specific key management using HSM
More?
AWS Accounts
Accounts Isolate Concerns
• paastest – for development and testing
– Fully functional deployment of all services
– Developer tagged “stacks” for separation
• Reservations
– Save up to 71%, priority when you request reserved capacity
– Unused reservations are shared across accounts
More?
Cloud Access Control
Cloud Access
audit log
developers ssh/sudo www- • Userid wwwprod
Gateway prod
Security groups don’t allow
ssh between instances
Zuul Traffic
Processing
and Routing
Z
U
U
L
Zuul Architecture
http://techblog.netflix.com/2013/06/announcing-zuul-edge-service-in-cloud.html
Ice – AWS Usage Tracking
http://techblog.netflix.com/2013/06/announcing-ice-cloud-spend-and-usage.html
NetflixOSS Continuous Build and Deployment
Cloudbees
Dynaslave
Jenkins AWS
AWS Build
Aminator Baked AMIs
Slaves
Bakery
AWS Account
Asgard Console
Archaius
Config Service
Multiple AWS Regions
Cross region Priam C*
Eureka Registry
Pytheas
Dashboards
Exhibitor
Zookeeper 3 AWS Zones
Atlas
Edda History
Monitoring
Application Clusters Priam Evcache
Simian Army Autoscale Groups Cassandra Memcached
Genie, Lipstick
Instances Persistent Storage Ephemeral Storage
Hadoop Services
More?
NetflixOSS Instance Libraries
Nominating Committee
Panel of Judges
Judges
Aino Corry
Martin Fowler
Program Chair for Qcon/GOTO Simon Wardley Chief Scientist Thoughtworks
Strategist
Twitter #cloudprize
Vendor Driven Portability
Interest in using NetflixOSS for Enterprise Private Clouds