Meet Flarion at AWS re:Invent in Las Vegas, Nov 30 to Dec 4. Let's meet up!
Customer story

AppsFlyer cut Spark costs 50% without rewriting a job.

AppsFlyer brings in about 1 PB of new data every day. Its platform team had already cut infrastructure costs by moving to EMR Serverless. AppsFlyer reported 50% lower costs across its compaction jobs with Flarion.

AppsFlyer • Mobile marketing attribution • In production
Music: “Digital Lemonade” by Kevin MacLeod (incompetech.com), licensed under CC BY 4.0.
At a glance
INDUSTRY
Mobile marketing attribution
PLATFORM
AWS, EMR Serverless
DATA VOLUME
About 1 PB of new data every day
WORKLOADS
Compaction, Kafka-to-S3 streaming
CUSTOM CODE
Java/Scala UDFs in streaming
TEAM
One senior platform engineer; weeks to production

“What surprised me was how fast it got to production. Bringing a new vendor into a data platform usually takes months. With Flarion, it was weeks.”

ADI BELAN
VP Engineering, Cloud, AI & Data, AppsFlyer
01 / THE STARTING POINT

AppsFlyer’s platform was already optimized.

AppsFlyer moved from Hadoop to Kubernetes to EMR Serverless and had already right-sized resources for Spark. Further savings had to come from somewhere else.

Start with the hardest test.

AppsFlyer came to Flarion with its hardest workload. Compaction was its largest recurring workload: about 200 jobs, each running at least once a day and some every hour. Each sorted and shuffled recent data into larger Delta Lake files.

The platform team had already optimized the cluster settings and the compaction code, and didn’t think there was much left to save. Flarion still cut the costs by 50%.

ALREADY OPTIMIZED
Compaction
Custom code, not Delta OPTIMIZE
Sort
In the job, before every write
Executors
Released after one idle second
Clusters
About 99% in use, by design
FLARION INSIDE A SPARK JOB
AppsFlyer's unchanged compaction job: Spark plans it as usual on EMR Serverless, Flarion upgrades the plan, and every operator (ScanParquet, Filter, Project, Sort, ShuffleExchange, WriteDelta) runs in Flarion's Rust engine, reading from and writing to Delta Lake on S3.
Compaction reads recent data, then writes larger Delta Lake files on S3.

Lower costs, without a rewrite.

AppsFlyer did not want another integration project. Flarion offered a way to lower costs without rewriting the existing Spark jobs.

Flarion rebuilt the compaction workload in its lab from AppsFlyer’s query plans. On Flarion’s engine, it projected 40 to 50% lower cost. The next step was to prove that on AppsFlyer’s jobs.

02 / THE IMPLEMENTATION

Flarion changed the engine. AppsFlyer kept its code.

One senior platform engineer worked with Flarion from the first test runs through production. The team added the engine through the container image, Spark settings and Airflow template it already used.

Before Flarion, the five compaction operators (ScanParquet, Filter, Sort, ShuffleExchange, WriteDelta) run on Spark execution. After Flarion, with one added Flarion configuration and the Spark code unchanged, the same five operators are Flarion Accelerated.
APPSFLYER’S CHANGES

AppsFlyer added two JARs to its EMR Serverless image, Flarion’s engine and its Delta Lake integration, plus four lines of Spark configuration. The image passed the usual CI and security scan.

WHAT RAN WITH FLARION

Flarion’s Rust engine ran every step of compaction: the read, the sort, the shuffle and the Delta write. AppsFlyer’s jobs ran as written, with no code changes.

CHECKED BEFORE PRODUCTION

Results on two test workloads matched Spark’s. Then all 200 compaction jobs moved to Flarion at once. Business data stayed in AppsFlyer’s AWS account. Flarion did not access it.

Compaction went first. Streaming followed.

01
Assessment

An offline assessment of the compaction workload projected 40 to 50% lower cost.

02
1 week of telemetry

The plugin set a baseline of runtime and cost for each workload.

03
Production

All compaction jobs went into production with Flarion. Costs and run times fell from day one.

04
Streaming

Kafka-to-S3 jobs followed with no lag or incidents. Flarion’s right-sizing guidance took the saving to 40 to 60%, depending on the workload.

03 / PROOF OF ROI

Switch it off, and the cost comes back.

With Flarion, AppsFlyer’s compaction jobs cost 50% less. While upgrading to a newer EMR release, the team ran them without Flarion. Costs rose and failures came back.

LOWER COST · ALL COMPACTION JOBS
50%lower cost
As measured on actual AWS bill
COMPACTION JOBS
~200
ALL IN PRODUCTION WITH FLARION
FAILED RUNS · ONE COMPACTION WORKLOAD
0 failures
WITH FLARION
Run time of one compaction workload in three periods: with Flarion; without Flarion, averaging 57 minutes with failed runs; with Flarion back, averaging 33 minutes with no failures.
One compaction workload · Without Flarion during an EMR upgrade · Source: Flarion telemetry

What the upgrade showed.

During the move to a newer EMR release, the team ran its compaction jobs without Flarion. Costs rose and runs started failing. When Flarion went back in, run times dropped and the failures stopped.

Faster and more reliable with Flarion.

The chart follows one of about 200 compaction jobs. With Flarion, it ran with no failures. Without Flarion, runs averaged 57 minutes and started to fail. With Flarion back, runs averaged 33 minutes with no failures.

04 / THE RESULTS

The jobs cost less to run.

MEASURE
RESULT
CONTEXT
Compaction jobs
50% lower
AWS bill, reported by AppsFlyer, across all compaction jobs.
Code and Spark tuning
0 changes
No job rewritten, no Spark tuning. Flarion was added through the container image.
Kafka-to-S3 streaming
40 to 60% lower
Cloud cost on the Kafka-to-S3 streaming jobs, reported by AppsFlyer; the saving depends on the workload.

“No issues with Flarion. No lag or incidents during the switch…”

IVAN KOSIANENKO · STAFF ENGINEER, APPSFLYER
WHAT IT TOOK

One senior platform engineer worked with Flarion from the first test runs through production, using the team’s existing image and job-submission process. Full rollout took weeks, and the savings started on day one: compaction cost less from its first production runs.

ROLLOUT SCOPE

Compaction went first, all of its jobs at once. Kafka-to-S3 streaming followed. Both run in production with Flarion.

“More and more of our resources are going into AI, and AI depends on high-quality data. Making Spark faster and cheaper lets us put fewer resources into the data platform and more into AI.”

ADI BELAN · APPSFLYER
VP Engineering, Cloud, AI & Data
flarion icon
Workload assessment

Start with your Spark jobs.

Estimate the savings with an assessment, then validate the result on your own jobs.