Netflix has a simple yet ambitious goal: to keep users engaged and streaming for as long as possible.
However, in a world where user attention spans are fleeting—averaging just 90 seconds before a decision is made—Netflix’s ability to deliver content swiftly is critical.
One of the core technologies that helps Netflix achieve this is EVCache, a distributed in-memory key-value store.
Here are four major use cases for EVCache at Netflix and how they contribute to keeping you streaming for as long as possible.
1 - Look-aside Cache
The first and perhaps most common use case for EVCache is as a look-aside cache.
This caching pattern ensures that frequently accessed data is readily available, reducing the time required to fetch data from backend services and databases.
How It Works:
When an application requests data, it first queries the EVCache client to see if the data is already cached.
If the data is not in the cache (a cache miss), the application fetches it from the backend service, which may involve querying the Cassandra database.
Once the data is retrieved from the database, it is stored in EVCache for future requests.
Why It Matters:
Reduced Latency: By serving data directly from the cache, Netflix can significantly reduce the time it takes to load recommendations, watch histories, or other user-specific data.
Scalability: Backend services and databases are spared from handling repetitive queries, allowing them to focus on other tasks.
Improved User Experience: Faster response times mean users can start streaming without delays, reducing the likelihood of them abandoning the platform.
Example Use Case:
Imagine a user navigating to the Netflix home page. The application needs to fetch personalized recommendations and thumbnails. Instead of querying the backend service for every user, EVCache serves these requests almost instantly, ensuring a smooth and engaging experience.
2 -Transient Data Store
Netflix also uses EVCache as a transient data store to manage temporary data that changes frequently but doesn’t require permanent storage. A prime example is playback session information.
How It Works:
A playback session begins when a user starts watching a show or movie. This session information, such as playback time and device details, is stored in EVCache.
Other services may update this session data (for example, when a user pauses or skips content).
At the end of the session, the data may be discarded or stored in a more permanent database for analytics.
Why It Matters:
Low Latency Updates: Transient data like session information requires real-time updates and reads, which EVCache handles efficiently.
Service Coordination: Since multiple services interact with playback data during a session, EVCache ensures that this data is accessible to all relevant services with minimal latency.
Cost Efficiency: EVCache provides a cost-effective solution for handling temporary data that doesn’t need to be stored long-term.
Example Use Case:
When a user pauses a movie on one device and resumes it on another, EVCache ensures that the playback position is instantly updated and available, enabling seamless transitions between devices.
3 - Primary Store
For some use cases, EVCache is not just a caching layer but acts as a primary data store. One prominent example is Netflix’s personalized home page, which is computed nightly for every user.
How It Works:
Large-scale pre-compute systems analyze each user’s watch history, preferences, and recommendation algorithms.
The result is a tailored home page, including categories, thumbnails, and recommendations for each profile.
This data is written to the EVCache cluster, where it is stored and served to the user’s device during their next session.
Why It Matters:
Pre-Computed Efficiency: By precomputing the home page, Netflix reduces the computational load during peak hours when users log in.
Scalability: EVCache’s distributed nature allows Netflix to handle millions of unique home pages across its global user base.
Instant Access: Storing the home page data in EVCache ensures low-latency retrieval, enabling Netflix to deliver a fully personalized experience as soon as the user opens the app.
Example Use Case:
When a user logs into their profile, the pre-computed data stored in EVCache is instantly retrieved to populate their home page. This allows Netflix to deliver recommendations without waiting for backend computations.
4 - High Volume Data
Netflix also uses EVCache for data that experiences high-volume access and requires high availability. One notable example is UI strings and translations shown on the home page.
How It Works:
A separate process asynchronously computes and publishes UI strings, such as titles, descriptions, and menu text, to EVCache.
These strings are then read by the application whenever needed, ensuring low latency and high availability.
Why It Matters:
Global Reach: With users around the world, Netflix needs to deliver localized content and UI strings in multiple languages.
High Availability: EVCache ensures that even under heavy traffic, essential UI elements are quickly and reliably available.
Improved User Experience: By caching these high-volume data elements, Netflix ensures consistent and fast loading times across all devices and regions.
Example Use Case:
When a user opens Netflix, the localized UI elements, such as titles and navigation options, are fetched from EVCache. This ensures that the interface is fully loaded before the user starts interacting with the app.
👉 So - which other caching use case have you come across?
Shoutout
Here are some interesting articles I’ve read recently:
Nobody told me I would miss my JOINs when I started in microservices by
Stop waiting for the perfect job - use what you have to build your future by
That’s it for today! ☀️
Enjoyed this issue of the newsletter?
Share with your friends and colleagues.
Great article, Saurabh. And thank you so much for the mention!
This was cool. I always wondered if it's "correct" to use in some special cases (like dashboards) a caching solution as a semi-permanent data store. Nice to see people already do this.
Thanks for the mention, Saurabh!