Netflix Tudum Architecture: from CQRS with Kafka to CQRS with RAW Hollow

Netflix Technology Blog
8 min readadvanced
--
View Original

Overview

The article discusses the evolution of Netflix's Tudum architecture, transitioning from a CQRS model utilizing Kafka to a more efficient system based on RAW Hollow. It highlights the challenges faced with eventual consistency and the performance improvements achieved through this architectural shift.

What You'll Learn

1

How to leverage RAW Hollow for improved data consistency and performance

2

Why decoupling read and write paths can enhance system scalability

3

How to implement a server-driven UI for dynamic content updates

Prerequisites & Requirements

  • Understanding of CQRS and event-driven architecture
  • Familiarity with Kafka and in-memory databases(optional)

Key Questions Answered

What architectural changes did Netflix implement for Tudum?
Netflix transitioned from a CQRS architecture using Kafka to a new system based on RAW Hollow, which improved data consistency and performance by embedding an in-memory client directly into read-path services, eliminating unnecessary I/O.
What are the challenges associated with eventual consistency in Tudum's architecture?
The main challenge was the delay between making an edit and seeing it reflected on the website, which involved multiple steps including saving data to a CMS, waiting for notifications, and processing through various layers before updates were visible to users.
How did RAW Hollow improve Tudum's data handling?
RAW Hollow provided a high-density near cache that significantly reduced I/O and allowed for synchronous data access in O(1) time, simplifying the architecture and improving fault tolerance while maintaining high availability.
What performance improvements were observed after migrating to RAW Hollow?
The migration to RAW Hollow resulted in a reduction of homepage construction time from approximately 1.4 seconds to 0.4 seconds, enabling faster previews for writers and editors while still providing high availability for visitors.

Key Statistics & Figures

Homepage construction time
decreased from ~1.4 seconds to ~0.4 seconds
This improvement was achieved after migrating to RAW Hollow, significantly enhancing performance.
Memory footprint for three years of unhydrated data
130MB
This is only 25% of its uncompressed size in an Iceberg table, showcasing the efficiency of RAW Hollow's compression.

Technologies & Tools

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

Backend
Kafka
Used for separating write and read databases in the initial architecture.
Backend
Raw Hollow
An in-memory, co-located, compressed object database that improved data consistency and performance.
Database
Cassandra
Used as a high-availability database for storing read-optimized content.

Key Actionable Insights

1
Implementing a server-driven UI can greatly enhance the flexibility of your application, allowing for dynamic updates without client-side changes.
This approach is particularly beneficial in environments where content needs to be frequently updated, such as streaming services.
2
Decoupling read and write paths in your architecture can lead to significant scalability benefits, allowing each path to be optimized independently.
This is crucial for applications with high traffic, where read and write operations can vary significantly in load.
3
Utilizing in-memory databases like RAW Hollow can drastically reduce data access times and improve overall application responsiveness.
This is especially important in user-facing applications where latency can impact user experience.

Common Pitfalls

1
Relying too heavily on eventual consistency can lead to significant delays in data visibility, impacting user experience.
This occurs when multiple steps are required to propagate changes, which can frustrate users expecting real-time updates.
2
Implementing caching without a clear strategy for cache invalidation can complicate data consistency.
Cache invalidation is a complex problem, and failing to address it can lead to stale data being served to users.

Related Concepts

Cqrs
Event-driven Architecture
Server-driven UI
In-memory Databases