The history of databases at Netflix: From Cassandra to CockroachDB

The history of databases at Netflix: From Cassandra to CockroachDB
[ Webinar ]

A Netflix engineer explains...

How Netflix unlocks analytical use cases using change data capture and CockroachDB

Watch now

In 2008, after Netflix pivoted from DVD-by-mail to streaming, they were running the streaming service on premise and suffered a 3-day outage. That was the beginning of their move to the cloud. First they moved to AWS. Then, in 2014, they adopted (and popularized!) Cassandra to support their need for global replication.

In this two-part presentation, Netflix Senior Software Engineers Shengwei Wang and Shahar Zimmerman explain why Netflix has adopted CockroachDB and how they’re deploying it. 

Three Netflix use cases that don’t fit Cassandra 

In 2019 Netflix began to run into problems with Cassandra for certain use cases. At that time Netflix was seeing an increase in demand and an increase in their database requirements. For example, the studio side of Netflix was producing more shows and movies which added new data needs. Generally speaking, there was an increase in the need for consistent data, specifically for these three use cases:

Cloud drive service: a file system-like service for media assets which was needed by the Netflix studio side of the business.

Content delivery: Netflix built its own CDN called Open Connect, and they needed a control plane service to manage network devices around the world.

Spinnaker: a continuous delivery platform on the cloud.

These are all global services that need to support consistent transactions at times. Supporting consistent transactions is problematic with Cassandra, because in Cassandra you don’t get rich transactions. Instead, you have lightweight transactions, which are extremely performant, but limited. Also, the secondary indices in Cassandra are unreliable and often don’t work. 

The other options Netflix considered for these use cases were AWS Aurora as well as AWS DynamoDB but they ran into some limitations with scalability there. 

Netflix decided that they needed a scalable SQL database for those three use cases and established a set of requirements: Multi-active topology, global consistent secondary indices, global transactions, open source, and SQL.

Why Netflix chose CockroachDB

As you can see from the graphic, CockroachDB satisfied each of these requirements and earned a seat at the Netflix architecture table. 

How is CockroachDB deployed at Netflix?

How Netflix uses CockroachDB

In 2020 Netflix deployed their first CockroachDB cluster in production. Today they have 100 production clusters and 150+  test clusters. At this time most of the clusters are deployed in a single region with three availability zones. The biggest CockroachDB cluster at Netflix is a 60-node, single-region cluster with 26.5 terabytes of data. 

In this section of the presentation, Shengwei Wang explains why Netflix does not use the CockroachDB binary, how Netflix navigates upgrades to new versions of CockroachDB, and how Netflix deploys/manages CockroachDB. You can get all those nuanced details directly from Shengwei right here:

More CockroachDB at Netflix resources

Since their adoption of CockroachDB in 2020 the Netflix tech blog has published a couple different articles about different use cases that leverage CockroachDB:

Orchestrating Data/ML Workflows at Scale With Netflix Maestro

Data Mesh — A Data Movement and Processing Platform @ Netflix

Unlocking analytical use cases at Netflix with CockroachDB

If you’re interested in learning how DoorDash, Booking.com, Santander, and other companies use CockroachDB you can find their presentations on our RoachFest home page, and you can read more case studies on our customers page.

About the author

Dan Kelly linkedin link

Dan has been producing technical blogs, videos, whitepapers, and webinars at Cockroach Labs for the last 4+ years. His mission is to identify the most pressing problems developers face and to create content to solve them. Outside of work Dan is usually chasing his three year old daughter or cooking something indulgent.

Keep Reading

How Netflix builds the infrastructure to stream on every device

The details in this post are based on The Netflix Tech Blog post titled “Towards a Reliable Device Management Platform”. …

Read more
How Netflix builds the infrastructure to stream on every device

The details in this post are based on The Netflix Tech Blog post titled “Towards a Reliable Device Management Platform”. …

Read more
How Netflix engineers choose their tech stack

Large enterprises with hundreds of developers building thousands of applications and services have a suite of database …

Read more