---
title: "How InMobi achieved 20x faster queries and 80% cost savings with ClickHouse"
description: "InMobi moved its publisher-facing real-time ad reporting APIs from a serverless warehouse on blob storage to ClickHouse."
url: "https://swe.quest/articles/how-inmobi-achieved-20x-faster-queries-and-80-cost-savings-with-clickhouse-7024c9110d80fdcc"
canonical: "https://clickhouse.com/blog/inmobi"
source: "ClickHouse"
published: "2026-02-25"
difficulty: "medium"
kind: "Case study"
reading_minutes: 8
tags: ["analytics","ads","cost-optimization","data-pipelines","resilience"]
---

# How InMobi achieved 20x faster queries and 80% cost savings with ClickHouse

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2026-02-25, 8 min read, Case study. Original: [https://clickhouse.com/blog/inmobi](https://clickhouse.com/blog/inmobi)

## Summary

InMobi moved its publisher-facing real-time ad reporting APIs from a serverless warehouse on blob storage to ClickHouse. P99 latency at peak dropped from over 60s to under 3s, and monthly cost fell from $40K to $8K. The workload is 400K+ daily queries over 10 TB of uncompressed data, which compresses to about 500 GB. Key engineering choices include: - hourly Spark ingestion into staging tables, validated and then promoted atomically via MOVE PARTITION to avoid duplicates from retries - isolated reader and ephemeral writer compute over shared storage - gevent-based async connection handling to fix OOMs caused by per-session memory overhead - automatic fallback to the old platform when failures exceed 2% in a 5-minute window Cost now scales in steps with added replicas, each adding about 30% capacity, rather than linearly with traffic.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Ads](https://swe.quest/tags/ads.md) (Domains)
- [Cost optimization](https://swe.quest/tags/cost-optimization.md) (Reliability & operations)
- [Data pipelines](https://swe.quest/tags/data-pipelines.md) (Data & databases)
- [Resilience](https://swe.quest/tags/resilience.md) (Distributed systems)

## Prerequisites

- columnar OLAP databases ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- Spark batch ingestion ([easy posts on Data pipelines](https://swe.quest/tags/data-pipelines.md?difficulty=easy))

## Keywords

ClickHouse, InMobi, Apache Spark, gevent, Grafana, Parquet, MOVE PARTITION

## Related posts

- [How AdGreetz Processes Millions of Daily Ad Impressions with ClickHouse Cloud](https://swe.quest/articles/how-adgreetz-processes-millions-of-daily-ad-impressions-with-clickhouse-cloud-923fb2f6799d75bf.md): ClickHouse · 2023-04-26 · Easy · 3 min read · Analytics & OLAP, Ads, Cost optimization, Serverless
  AdGreetz moved its ad impression analytics from AWS Athena to Snowflake and then to ClickHouse Cloud, citing roughly six times lower cost than a small Snowflake standard plan and sub-second rather than multi-second queries.
- [Why m3ter chose ClickHouse Cloud](https://swe.quest/articles/why-m3ter-chose-clickhouse-cloud-3bab684612a2e50e.md): ClickHouse · 2025-01-14 · Medium · 16 min read · Analytics & OLAP, Databases, Performance engineering, Cost optimization, Payments & fintech
  m3ter, a usage-based billing service, picked ClickHouse Cloud for its usage-data plane after proof-of-concept tests against Snowflake, Firebolt, Redshift and Aurora Postgres.
- [Migrating to ClickHouse Cloud in just three months with no downtime: A 120 terabyte data journey and its benefits](https://swe.quest/articles/migrating-to-clickhouse-cloud-in-just-three-months-with-no-downtime-a-120-38c02d31adc19578.md): ClickHouse · 2024-08-14 · Easy · 12 min read · Analytics & OLAP, Cloud platforms, Data pipelines, Cost optimization
  Azur Games moved a 120 TB self-managed ClickHouse 21.3 analytics deployment (45 servers, MinIO, old Airflow) to ClickHouse Cloud on AWS in three months with no analytics downtime.
- [How Buildkite transformed test analytics and cut costs with ClickHouse Cloud](https://swe.quest/articles/how-buildkite-transformed-test-analytics-and-cut-costs-with-clickhouse-cloud-3d237a53f50d4550.md): ClickHouse · 2026-01-27 · Easy · 8 min read · Analytics & OLAP, Cost optimization, Stream processing, CI/CD, Testing
  Buildkite Test Engine replaced a Kafka/Flink pipeline that pre-aggregated test metrics into Postgres, DynamoDB and Iceberg with on-demand queries against ClickHouse Cloud, letting customers group and filter billions of test executions by arbitrary JSON tags in real time.
- [How Rokt Achieved Real-time Reporting with ClickHouse](https://swe.quest/articles/how-rokt-achieved-real-time-reporting-with-clickhouse-89f752e157ebd50c.md): ClickHouse · 2022-12-06 · Easy · 4 min read · Analytics & OLAP, Databases, Cost optimization, E-commerce
  Rokt replaced an Elasticsearch-backed reporting layer with ClickHouse.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
