AdForm Divorces Cassandra: Scales Performance by 4x with 2x Fewer Servers

AdForm is a fast growing European company with a unique platform that combines rich media formats, real-time bidding and traditional ad-serving technologies. A Microsoft shop, Cassandra was the first open source project in the company and the first project on Linux.

Tadas Pivorius, who describes himself as “a simple developer”, recently talked about being “married to Cassandra”, “sad and happy moments”, “sleepless nights” and “intense days” based on 26,000 hours or 3+ years of experience with Cassandra (since V0.7 beta) including writing a .net client with advanced functionality very similar to a client that Netflix later released.

     With Aerospike, we have been able to drastically cut down on the number of Cassandra servers, which provided a great cost reduction. Even more important is the super fast key-value store and extraordinary predictability we get with Aerospike, providing the responsiveness our clients require to compete in the crowded Internet and mobile markets.

– Jakob Bak, CTO

When the company decided to build Demand Side Platform (DSP) and Data Management Platform (DMP) functionality, they needed their user profile store and id-mapping store to run on a NoSQL database that could perform multiple reads and writes within 50 milliseconds. That was a “game changer” and “sad moment” for AdForm.

AdForm moved from Windows to Linux, VM to bare metal, built and open sourced their smart Cassandra client, and optimized everything possible. According to Tadas, people, including professional Cassandra consultants thought they were “doing something wrong or are insane because if you open the Cassandra site, you read that it’s fast, scalable…“ However, Tadas noted they were tuning settings all the time and with their application changing, data changing, rows becoming wider etc, they struggled with stability problems. It was “very time consuming to ensure stability for the Cassandra cluster under high load.” In addition, because AdForm is a small company with it’s own data center, they wanted smaller clusters, not hundreds and thousands of servers like Netflix.

Just when things were finally stable, they were told they had to scale 4x. That was when “we decided we are tired and we can’t handle it anymore” and set out to search for alternatives, a database with consistent high performance that would be easier to maintain. They looked at a number of options and decided to give Aerospike a shot.

    Of course, the story was not quite happy because it was not open source at that time. It costs, actually, in my opinion, a lot of money. My flat cost less. The marketing in papers looked too good, and when you’re a developer, you are filtering out all this bullshit about fast, reliable, and scalable. You are tired of these things. So everyone was skeptical, but we decided to try.

– Tadas Pivorius

They started a POC with “cheap” SSDs, fat nodes and no tweaks. “After one week we forgot all our skepticism and what was POC became Production.”

Adform scaled from a 32 node Cassandra cluster to a 3-node Aerospike cluster in each of 2 data centers, managing 1 TB of data on Intel SSDs, processing 120k reads per second and 8k writes per second, with 200k TPS peaks.