Case Study: MediaMath Innovates AdTech at Scale with ScyllaDB

By Knight Fu, Director of Engineering, MediaMath

About MediaMath

As the leading independent programmatic ad tech company, MediaMath has steered the evolution of the demand-side platform (DSP) sector since 2007. Their business has become a globally scaled, enterprise-grade DSP and data management platform (DMP) offering that delivers personalized digital advertising across all addressable touchpoints. With advertisers in 42 countries around the world, MediaMath does business across all verticals, including retail, consumer packaged goods, travel, and finance. Notable customers include IBM and Uber, and a range of marquee clients who want to elevate their marketing by innovating at scale with new ideas, tools, and trends.

MediaMath is on a mission to build a more accountable, addressable supply chain that drives better outcomes for marketers and publishers while delivering better experiences for consumers. The company provides the industry’s most complete multi-channel access within a unified workflow, spanning display, video, mobile, audio, native, digital out of home, and Advanced TV. In addition to its integrated DSP and DMP, MediaMath provides a number of other unique offerings. MediaMath Audiences power predictive modeling that helps to identify the best customers. Mediamath Brain, a machine-learning algorithm, makes millions of decisions per second in real-time to help advertisers reach their target audience. MediaMath’s platform exposes APIs to these offerings, and a professional services team helps customers from solution design to onboarding, education, and training through the full life cycle of the engagement.

The Challenge

Three metrics frame the technical challenge that MediaMath is solving: Data volume from media touchpoints, transactions per second, and real-time bid-matching analytics. MediaMath customers expect a real-time response to campaign activity and segmentation populations at scale.

In its initial attempt to meet some of these challenges, MediaMath ran up to 60 Cassandra nodes on AWS servers. However, the number of nodes and the complexity of Cassandra placed a tremendous operational burden on the MediaMath team. Cassandra required two to three full-time site reliability engineers to keep the cluster running. When nodes went down, restoring them proved to be an intensive, manual process. Cassandra also created testing and maintenance drudgery around compactions and JVM garbage collection, in addition to the work of constantly tuning the CPU usage on those machines.

MediaMath cleary needed to find an alternative.

“Of all of the database migrations I’ve worked on in my career, ScyllaDB was the smoothest, for sure.”

– Knight Fu, Director of Engineering, MediaMath

The Solution

A MediaMath engineer noticed chatter on Reddit about a new technology called ScyllaDB that claimed to be a drop-in replacement for Cassandra. Noting that ScyllaDB is implemented in C++ instead of Java, he evangelized it inside the team.

Two overriding criteria for MediaMath’s evaluation were Cassandra compatibility and performance benchmarks. “We wanted to make sure that what we were switching onto was not going to incur a lot of development work on our side, and that worked out great.”

The installation and evaluation process went smoothly. “Of all of the database migrations I’ve worked on in my career, ScyllaDB was the smoothest, for sure,” said Knight Fu, Director of Engineering at MediaMath “There weren’t any tooling changes that were required for our automation either, which was a huge plus. From our point of view, one day it was Cassandra, and the next day it was ScyllaDB. Seemed as though it was as easy as that.”

A key driver in the decision to go with ScyllaDB is its lower operational overhead. Ultimately, ScyllaDB enabled MediaMath to realize efficiency gains and pivot resources to focus on other important projects.

Today, MediaMath runs 17 ScyllaDB nodes on i3.metal AWS instances, handling about 200,000 events per second and performing about a million reads per second. Read latency is consistently below the company’s 10-millisecond threshold.

“With ScyllaDB, our uptime was tremendous throughout the last holiday — 99.9999% availability with ScyllaDB.”

The MediaMath team appreciates the benefits of Cassandra compatibility. “Our access pattern into the database was relatively new, so being able to keep our schemas was a huge benefit. Not having to retool monitoring and active node management when going from Cassandra to ScyllaDB was also really valuable.”

ScyllaDB’s efficiency also enabled MediaMath to directly enhance its data management platform service. “Thanks to ScyllaDB, we’re increasing data retention in our segmentation product and delivering new value to clients without a price increase,” said Emera Trujillo, Senior Product Manager at MediaMath.