The history of databases at Netflix & how they use CockroachDB

The history of databases at Netflix & how they use CockroachDB

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 got on AWS. Then, in 2014, they adopted (and popularized!) Cassandra to support their need for global replication.

In this two-part presentation, Shengwei Wang and Shahar Zimmerman (both Senior Software Engineers), 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 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

• Coming Soon…Unlocking analytical use cases at Netflix with CockroachDB

If you’re interested in learning how Twitter, Shipt, Starburst 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

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.

linkedin link

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
Netflix, Twitter, & DoorDash: Highlights from CockroachDB's RoachFest

Vlad Sydorenko, a senior software engineer at Netflix, stood up in the audience and asked for the microphone: “When you …

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
x
Developer Resources