Streamlining Contract Management in Revenue Infrastructure

Netflix Technology Blog
6 min readNov 4, 2024

--

By Austin Gundry, Travis Chun, Zian Hu

Introduction

At Netflix, a core tenet on our mission to entertain the world is meeting customers where they are. This means building intuitive signup flows on their favorite devices, or bundling Netflix subscriptions with services they already know and trust. To do this, we invest heavily in our partner relationships to incentivize and compensate them for making these customer touch points as reliable as possible.

These incentive agreements can take many forms, but two common patterns are partners integrating Netflix SDKs to help drive signups on their devices or bundling Netflix subscriptions with their products or services. Netflix in turn compensates the partners for these efforts so that both Netflix and the partner benefit while growing the member base.

With the rapid expansion of our streaming business, we were left with several disjoint systems governing these partner agreements and their downstream financial transactions. To realign for the future, we recently built a new tool to store this contract information, automate all associated financial transactions, and add layers of innovation that will allow us to remain operationally excellent. Most importantly, these contracts are now centrally managed in one location, significantly reducing the complexity of contract maintenance. We’re proud to present this project as an example of how we use software to enable our business and delight our stakeholders.

Motivation

Partner contracts cover broad relationships that can have a wide variety of terms and conditions dictating the partner’s compensation. This wide variety is worth supporting because partner-originating subscriptions are a significant portion of our member base. With this significant portion of revenue comes rigid requirements for meeting security guidelines, government audit requirements, and ensuring complete and accurate transactions with our partners.

Every month we have to close our financial books, and we strive to close within 3 to 5 days while most companies of our size close in 7 to 10 days. To do this, we have an incredible team of revenue accountants, but they require tools that allow them to operate at the best of their ability. This blog post details how we built our new Agreements tool.

Requirements

Netflix generates financial events for millions of subscribers every day, and all of these events need to be processed to determine the compensation commitment to our partners. Further, our system is in the signup path for new members so downtime must be avoided at all costs. The resulting financial impact is very much material, so auditing, observability, versioning, and security are mission-critical for the success of this tool. Finally, from a UX standpoint, making changes to agreements in this tool needs to be intuitive and approachable because the risk of misconfiguration carries significant financial consequences.

Below you’ll find a high-level diagram of the flow of information:

Data Model

Beginning with our data model, these contracts previously existed across 5 subsystems that were all built independently, so the first step was identifying a data model with extensibility in its DNA. To that end, we came up with 5 major components:

Metadata: High-level attributes like IDs, expiration dates, or links to the original PDF contracts.

Obligation: Identifies a product type through which we owe compensation

Eligibility Mechanic: Criteria to evaluate which financial events are applicable to a given term

Quantification Mechanic: Terms used to calculate partner compensation on the eligible financial event

Processor: Defines any additional aggregate processing needed

An example agreement might look like the following:

Data Storage

With a data model that we’re confident will extend to future generations of partnerships, we moved to identifying a storage solution that met our functional requirements. While document storage systems might seem like the natural choice due to their flexibility, frequently repeating sub-terms of individual contracts gave our data more of a relational structure. ACID compliance of relational databases also provided all-or-nothing guarantees which resolved previous pain points where edits across the many contract sub-systems could occur out-of-sync. Finally, these contracts are only updated when partner agreements are renegotiated so write volume of the system is expected to remain very low relative to reads. In the end, we landed on using CockroachDB as Netflix’s paved path RDBMS technology of choice. Finally, our front-end team or downstream clients can then fetch this information over gRPC or GraphQL interfaces.

Contract versioning and approval was implemented at the database schema layer, but we have also been able to take advantage of in-house Change-Data-Capture solutions for additional observability on edits. Finally, we needed extra redundancy for one subset of agreements related to sign up promotional codes as the signup path at Netflix is mission critical. To do this, we periodically backup these agreements to S3. Even if our entire database cluster is unresponsive, the application can still startup and satisfy these specific promotional requests.

Migration and Launch

Putting these agreements into action, we have an event processing architecture that listens for financial events over Kafka, and uses our new contract data to calculate the partner compensation impact. As contracts are updated, our system can replay all association financial events within the recent period to self-correct for any discrepancies. We built migration utilities to aggregate the contract details in each of the legacy systems, translate them to the modern definitions, and write these definitions into the new tool. From there, we set up shadow writes in our calculation pipeline so that we could audit a comparison of three months’ worth of financial data to make sure there were no regressions. With sign-off from our internal audit team after a comprehensive review, we were ready to launch.

Looking to the Future

Now that the system is in production, we can start to explore exciting areas of contract enablement. Our design and front-end teams built an incredible UX and we want to add to that with features like backdating contract changes or preview utilities to estimate impacts of contract changes.

This innovation would not have been possible without significant time investment from our accounting, tax, legal, and business development teams. If this sort of work excites you, consider joining the Revenue Infrastructure team as this is just the tip of the iceberg. We are excited about the upcoming opportunities and our team will be publishing more blog posts soon detailing how we maintain Netflix’s financial data, so stay tuned!

Acknowledgments

Special thanks to our stunning colleagues who contributed to this project’s success: Abbey Wang, Christine Kyauk, Eric Snell, Jessee Johnson, Jéssica Joaquim, Eugene Chiriliuc, Kalina Panayotova, Kamran Kotobi, Mario Camacho, Natali Itzler, Nicholas Pedroso, Sripaul Chidambaram Asokan

--

--

Netflix Technology Blog

Learn more about how Netflix designs, builds, and operates our systems and engineering organizations