Scaling Time Series Data Storage — Part I

by Ketan Duvedi, Jinhua Li, Dhruv Garg, Philip Fisher-Ogden

Netflix Technology Blog
11 min readintermediate
--
View Original

Overview

This article discusses Netflix's evolution of its time series data storage architecture to manage the massive growth of viewing history data. It highlights the challenges faced with initial designs and the strategies implemented to enhance performance and scalability.

What You'll Learn

1

How to design a scalable time series data storage architecture

2

Why to implement a caching layer for improving read latencies

3

When to use compression for data storage efficiency

4

How to manage large datasets with chunking techniques

Prerequisites & Requirements

  • Understanding of time series data and data storage concepts
  • Familiarity with Cassandra and caching mechanisms(optional)

Key Questions Answered

How does Netflix handle the scaling of viewing history data?
Netflix scales its viewing history data by redesigning its storage architecture to separate recent and archival data. This allows for efficient storage and retrieval, addressing the challenges posed by growing member counts and viewing hours.
What are the benefits of using a caching layer in data storage?
A caching layer improves read latencies by serving frequent requests from memory instead of querying the database. This reduces the load on the database and enhances overall system performance, especially during peak usage times.
What redesign strategies did Netflix implement for viewing history storage?
Netflix implemented a dual storage approach with Live Viewing History for recent records and Compressed Viewing History for older records. This strategy optimizes storage efficiency and read/write performance by using compression and chunking.
What challenges did Netflix face with its initial data storage architecture?
The initial architecture faced challenges such as high storage costs and slow performance due to increasing row sizes as member viewing history grew. This necessitated a redesign to maintain efficiency as data volume increased.

Key Statistics & Figures

Data size reduction
6X
The redesign achieved a sixfold reduction in data size through compression techniques.
System time spent on maintenance
13X reduction
The new architecture reduced the time spent on Cassandra maintenance significantly, improving operational efficiency.
Average read latency
5X reduction
The redesign led to a fivefold decrease in average read latency, enhancing user experience.
Average write latency
1.5X reduction
The architecture improvements resulted in a 1.5 times reduction in average write latency.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Database
Cassandra
Used for storing viewing history data due to its efficiency with write-heavy workloads.
Caching
Evcache
An in-memory caching layer implemented to improve read latencies.

Key Actionable Insights

1
Implement a caching layer to enhance read performance for frequently accessed data.
By caching data in memory, you can significantly reduce read latencies, especially in high-traffic applications. This approach is particularly effective for time-sensitive data retrieval.
2
Consider data compression techniques to optimize storage costs.
Compressing older data can lead to substantial savings in storage space, allowing for more efficient use of resources as your dataset grows.
3
Utilize chunking for managing large datasets effectively.
Chunking allows for parallel processing of data, which can help maintain performance levels even as the size of the dataset increases. This is crucial for applications with variable data sizes.

Common Pitfalls

1
Overloading a single database table with too much data can lead to performance degradation.
As data grows, the read and write latencies can increase significantly if not managed properly. It's essential to design your data model to accommodate growth.
2
Neglecting to implement a caching strategy can result in unnecessary load on the database.
Without a caching layer, frequently accessed data will always hit the database, leading to slower response times and increased operational costs.

Related Concepts

Time Series Data Management
Data Compression Techniques
Caching Strategies
Database Scaling Solutions