SlideShare a Scribd company logo
NETFLIX’S BIG LEAP
FROM
ORACLE TO C*
ROOPA TANGIRALA
Engineering Manager
Netflix
WHO AM I?
Engineering Manager @ Netflix
Twitter - @roopatangirala
Email roopa.tangirala@gmail.com
Linkedin - https://www.linkedin.com/pub/roopa-tangirala/3/960/2b
OVERVIEW
• Brief History
• Set up
• Migration Strategy
• Migration Challenges
• Example of Real use cases
• Lessons learnt
1997
DATACENTER
BACKEND
ORACLE DATAMODEL LIMITATIONS
NO HORIZONTAL SCALING
LICENSE COST
EVERY TWO WEEKS!!
2008
MOVE TO CLOUD
REQUIREMENTS
• HIGHLY AVAILABLE
• MULTI DATACENTER SUPPORT
• PREDICTABLE PERFORMANCE AT SCALE
WHY C* ?
• Massively scalable architecture
• Multi-datacenter, multi-directional replication
• Linear scale performance
• Transparent fault detection and recovery
• Flexible, dynamic schema data
• Guaranteed data safety
• Tunable data consistency
BACKEND NOW
MICRO SERVICES
• Horizontal, Homogenous, Commoditized
DOWNTIME
ALMOST DAILY PUSHES
ACTIVE ACTIVE
GLOBAL PRESSENCE
MIGRATION STRATEGY
BABY STEPS
NEW FEATURES FIRST TO CLOUD
DATA MODEL REVIEW
keyspace
column family
Row
column
•name
•value
•timestamp

DB/Schema
Table
Row
column
• name
• value
O
R
A
C
L
E
CASSANDRA
SCHEMALESS DESIGN
• Row-oriented
• Number of columns/Names can differ
namexyz Paul zip 95123
nameabc Adam zip 94538 sex Male
namecde XYZ
UNDERSTAND WRITE PATH
client
Commit
log (Disk)
Memtable
(memory)
sstable sstable sstable
Flush
UNDERSTAND READ PATH
client
memtable
sstable
sstable
sstable
Row cache/key cache
LOGIC IN APPLICATION
• Stored procedures
• Functions
• Triggers
• Referential integrity constraints
DATACENTER AWS
ORACLE
C*
APP
DUAL WRITESREADS
CONSISTENCY
CHECKER
WRITES
READS
WRITES
FORKLIFT
MAIN APPROACH
• DUAL WRITES
• FORKLIFT OLD DATASET
• CONSISTENCY CHECKER
• MIGRATE READS TO C* FIRST
• SWITCH OFF WRITES TO DC
Relationships – Better in App Layer
ORACLE SEQUENCE
• USE UUID for Unique keys
• Distributed Sequence Generator for Ordering
• C* counters – not so much
Heavy Transactional Use Case
RDBMS
CHALLENGES
SECURITY
DENORMALIZE
DENORMALIZE
DENORMALIZE
DENORMALIZE
DENORMALIZE
Roman Riding
Model Around Queries
Engineering Effort
Know limitations
SOURCE OF TRUTHF TRUTH
REAL EXAMPLES
API
• High concurrency
• Range scans
• ~1MB of data
• Caused heap issues at Cassandra level
• Very high read latency
Range scan replaced with
inverted index
0000/odp/{ui}/pathEvaluator_2 active Scripts_1 Text datafalseallocation
0000
/xbox/{ui}/pathEvaluator_
1
active Scripts_1 Text datafalseallocation
0000/tvui/{ui}/pathEvaluator_1 active Scripts_1 Text datafalseallocation
active_Scripts_idx
1,
2
Idx_1 /tvui/{ui}/pathEvaluator 2/odp/{ui}/pathEvaluator 2/odp/{ui}/pathEvaluator 2/odp/{ui}/pathEvaluator
scripts
client
1
2
Inverted Index considerations
• Column name can be used a row key placeholder
• Hotspots!!
• Sharding
VIEWING HISTORY
Growth of Viewing History
47
Problem
Growth Pattern: “Hockey-stick”
Retention Policy: Retain forever
Access Pattern: Retrieve all for a
customer
Scaling and performance challenges as the data
grows
48
Goals
Small Storage Footprint
Consistent Read/Write Performance
Infinite Scalability
49
Old Data Model
50
Old Data Model - Pros
Simple Wide Rows
No additional processing
Fast Write
Fast Read for Majority
51
Old Data Model - Cons
Read latency increases as number of viewing records
increases
Cassandra Internal
• Number of SSTables
• Compaction
• Read Repair
Lesson learned : Wide Row Limitation
52
New Data Model
Split Viewing History into two Column Families
1. Recent
• Small records with frequent updates
• Cassandra tuning : compaction, read
repair, etc.
2. Compressed
• Large historical records with rare updates
• Rollup
• Compression
• Cassandra: rare compaction, no read repair
53
New Data Model cont’d
54
RESULTS
55
Think Data Archival
Data stores grow exponentially
Have a process in place to archive data
• Moving to a separate column family
• Moving to a separate cluster (non SSD)
• Setting right expectations w.r.t latencies
with historical data
Cassandra TTL’s
Cinematch Rating Service
• First Model
• Second Model
Movie_id12345 BLOB
Movie_id4355 BLOB
545 1 545 4 545 534512345 4 545 2
454355 2 66 2 67 4
WHAT WORKED?
12345
4355
343 674
5
Name
3
4542443 242 Name
BLOB
4 BLOB52
BLOB vs COLUMN/VALUE
Try out column/value approach first and hopefully
it satisfies avg/95/99th
Column value pro’s:
• Write payload can be smaller
• Query by specific columns
• Read path does not require reading the entire row
Blob considerations
• Read percentage is very high (90’s)
• Read latencies are very important
• All the data is read most of the time
LESSONS LEARNT
• Get the model right
• Baby Steps
• Huge Engineering effort
• Think Compression
• Performance test
• DB just for Data
WE ARE HIRING !! – CHECK OUT JOBS.NETFLIX.COM

More Related Content

PPTX
Manage Microservices & Fast Data Systems on One Platform w/ DC/OS
PDF
Streaming all over the world Real life use cases with Kafka Streams
PDF
Hybrid Apache Spark Architecture with YARN and Kubernetes
PPTX
Ozone: scaling HDFS to trillions of objects
PPTX
In Search of Database Nirvana: Challenges of Delivering HTAP
PDF
Realizing the promise of portable data processing with Apache Beam
PDF
Bravo Six, Going Realtime. Transitioning Activision Data Pipeline to Streamin...
PPTX
AliCloud Object Storage Service (OSS) Core Features
Manage Microservices & Fast Data Systems on One Platform w/ DC/OS
Streaming all over the world Real life use cases with Kafka Streams
Hybrid Apache Spark Architecture with YARN and Kubernetes
Ozone: scaling HDFS to trillions of objects
In Search of Database Nirvana: Challenges of Delivering HTAP
Realizing the promise of portable data processing with Apache Beam
Bravo Six, Going Realtime. Transitioning Activision Data Pipeline to Streamin...
AliCloud Object Storage Service (OSS) Core Features

What's hot (20)

PDF
NoSQL and Spatial Database Capabilities using PostgreSQL
 
PPTX
Discovery Day 2019 Sofia - What is new in SQL Server 2019
PPTX
Bi and AI updates in the Microsoft Data Platform stack
PPTX
How Tencent Applies Apache Pulsar to Apache InLong - Pulsar Summit Asia 2021
PPTX
Discovery Day 2019 Sofia - Big data clusters
PDF
Change data capture with MongoDB and Kafka.
PPTX
Pulsar in the Lakehouse: Apache Pulsar™ with Apache Spark™ and Delta Lake - P...
PPTX
Containerized Hadoop beyond Kubernetes
PDF
Big Telco - Yousun Jeong
PDF
Cassandra at eBay - Cassandra Summit 2012
PDF
RedisConf17 - Redis Enterprise on IBM Power Systems
PPTX
Securing Data in Hadoop at Uber
PDF
More Data, More Problems: Scaling Kafka-Mirroring Pipelines at LinkedIn
PPTX
What's the Hadoop-la about Kubernetes?
PPTX
Symantec: Cassandra Data Modelling techniques in action
PDF
Big Data Tools in AWS
PDF
Public Cloud Workshop
PDF
Keeping Identity Graphs In Sync With Apache Spark
PPTX
Graphene – Microsoft SCOPE on Tez
PDF
Real-Time Machine Learning with Redis, Apache Spark, Tensor Flow, and more wi...
NoSQL and Spatial Database Capabilities using PostgreSQL
 
Discovery Day 2019 Sofia - What is new in SQL Server 2019
Bi and AI updates in the Microsoft Data Platform stack
How Tencent Applies Apache Pulsar to Apache InLong - Pulsar Summit Asia 2021
Discovery Day 2019 Sofia - Big data clusters
Change data capture with MongoDB and Kafka.
Pulsar in the Lakehouse: Apache Pulsar™ with Apache Spark™ and Delta Lake - P...
Containerized Hadoop beyond Kubernetes
Big Telco - Yousun Jeong
Cassandra at eBay - Cassandra Summit 2012
RedisConf17 - Redis Enterprise on IBM Power Systems
Securing Data in Hadoop at Uber
More Data, More Problems: Scaling Kafka-Mirroring Pipelines at LinkedIn
What's the Hadoop-la about Kubernetes?
Symantec: Cassandra Data Modelling techniques in action
Big Data Tools in AWS
Public Cloud Workshop
Keeping Identity Graphs In Sync With Apache Spark
Graphene – Microsoft SCOPE on Tez
Real-Time Machine Learning with Redis, Apache Spark, Tensor Flow, and more wi...
Ad

Similar to Netflix's Big Leap from Oracle to Cassandra (20)

PPTX
Cassandra Data Modeling - Practical Considerations @ Netflix
PPTX
Cassandra from the trenches: migrating Netflix
PPTX
Svccg nosql 2011_v4
DOCX
llr+ cHApTEFt s Database Processing(2) Does this design e.docx
PDF
Cassandra Day Denver 2014: Transitioning to Cassandra for an Already Giant Pr...
PPTX
Cassandra from the trenches: migrating Netflix (update)
PDF
Apache Cassandra & Data Modeling
PPTX
Learning Cassandra NoSQL
PPT
Webinar: 2 Billion Data Points Each Day
PDF
C* Summit 2013: The World's Next Top Data Model by Patrick McFadin
PDF
Cassandra Community Webinar | The World's Next Top Data Model
PPTX
cassandra_presentation_final
PDF
Cassandra Data Modelling with CQL (OSCON 2015)
PDF
The world's next top data model
PDF
Emerging database landscape july 2011
PDF
Macy's: Changing Engines in Mid-Flight
PPTX
DataStax C*ollege Credit: What and Why NoSQL?
PDF
Relational Scaling and the Temple of Gloom (from Cassandra Summit 2015)
PDF
Building your First Application with Cassandra
PPTX
Introduction to cassandra
Cassandra Data Modeling - Practical Considerations @ Netflix
Cassandra from the trenches: migrating Netflix
Svccg nosql 2011_v4
llr+ cHApTEFt s Database Processing(2) Does this design e.docx
Cassandra Day Denver 2014: Transitioning to Cassandra for an Already Giant Pr...
Cassandra from the trenches: migrating Netflix (update)
Apache Cassandra & Data Modeling
Learning Cassandra NoSQL
Webinar: 2 Billion Data Points Each Day
C* Summit 2013: The World's Next Top Data Model by Patrick McFadin
Cassandra Community Webinar | The World's Next Top Data Model
cassandra_presentation_final
Cassandra Data Modelling with CQL (OSCON 2015)
The world's next top data model
Emerging database landscape july 2011
Macy's: Changing Engines in Mid-Flight
DataStax C*ollege Credit: What and Why NoSQL?
Relational Scaling and the Temple of Gloom (from Cassandra Summit 2015)
Building your First Application with Cassandra
Introduction to cassandra
Ad

Recently uploaded (20)

DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Electronic commerce courselecture one. Pdf
PPT
Teaching material agriculture food technology
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Approach and Philosophy of On baking technology
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Empathic Computing: Creating Shared Understanding
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
The AUB Centre for AI in Media Proposal.docx
NewMind AI Weekly Chronicles - August'25 Week I
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
NewMind AI Monthly Chronicles - July 2025
Electronic commerce courselecture one. Pdf
Teaching material agriculture food technology
MYSQL Presentation for SQL database connectivity
Dropbox Q2 2025 Financial Results & Investor Presentation
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Approach and Philosophy of On baking technology
Advanced methodologies resolving dimensionality complications for autism neur...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Network Security Unit 5.pdf for BCA BBA.
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Review of recent advances in non-invasive hemoglobin estimation
Empathic Computing: Creating Shared Understanding
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...

Netflix's Big Leap from Oracle to Cassandra

Editor's Notes

  • #8: RDBMS not flexible enough to handle modern day applications, which are a mixture of structured, semi-structured and unstructured data. WHILE Oracle handles structured data well it lacks dynamic datamodel which is important for high traffic modern applications.
  • #9: Oracle scales up , master slave design limits both its scalability and performance for online applications, the failure of Oracle to add more capacity online in an elastic fashion without impacting the applications is a major drawback. IBM power 7 , 32 dual core 64 bit multiprocessors, 750GB RAM, TB’s storage allocated via SVC MCS cluster which is 8G4 cluster with 4GB/sec interface running with RAID 10 configurations.
  • #11: Website went down every two weeks to include changes to PLSQL procedures, packages, schema changes and other backend database changes. Was ok for DVD since the shipping could happen after the site was back up but not acceptable for streaming service.
  • #13: 1. Re-architect – question everything including keeping our own DC 2. Letting AWS focus on DC allows our engineers to focus on building and improving our business 3. Ideal for horizontal scaling architecture – even if we are not able to predict the customer growth 4. Cloud computing is the future.
  • #25: Rdbms backgroud Keyspace -> DB CF -> Table Row groups columns Each column is a triplet Column naming is not necessary/could be different. Column comparator specifies the sorting.. No need to stick to certain rules Name -> sorted Timestamp -> conflict resolution
  • #26: Rows are indexed Columns are sorted based on comparator you specify, so use it to your benefit Keep column names short as they are repeated Column size = 15 bytes + size of name + size of value Don’t store empty columns if there is no need – schema free design
  • #27: Commit log for durability – sequential write Memtable – no disk access (no reads or seeks) Sstables written sequentially to the disk
  • #28: 2 digest query/ 1 complete data response. The optimization is only on the bandwidth Number of replicas contacted depend on the consistency level specified Hinted handoff, read repair, antientropy node repair
  • #44: API servers autoscale or new push, they need to read majority of rows in scripts column family
  • #45: Simple but powerful concept – based on premise that rows are indexed and point looks are faster Create another column family and store list of all required rowid’s for faster lookup
  • #46: Wide row can reside only on one node.. And that can create hot spots Sharding – application logic / buckets
  • #47: Each customer id we have a row in cassandra Keep appending columns as and when customer generates viewing history
  • #51: Viewing history for one customer is stored in one wide row with row key CustomerID in cassandra. Write One viewing record is inserted as a new column when a customer starts playing a movie (aka Open a stream). Viewing record is updated after customer pauses or stops related playback. Read Read whole row at once to retrieve all viewing records for one customer. This is efficient initially when number of records per customer is small. Read whole row via pagination for large viewing history read latency increases as number of viewing records increases
  • #57: We don’t have linear growth TTL fascinating feature… coming from oracle background