---
title: "10x improved response times, cheaper to operate, and 30% storage reduction: why Instabug chose ClickHouse for APM"
description: "Instabug moved its mobile APM backend (about 3 billion events per day at roughly 2 million per minute) from Elasticsearch to self-managed ClickHouse after shard tuning and daily indexes failed to keep up with reads and writes."
url: "https://swe.quest/articles/10x-improved-response-times-cheaper-to-operate-and-30-storage-reduction-why-e1588b943b919f57"
canonical: "https://clickhouse.com/blog/10x-improved-response-times-cheaper-to-operate-and-30-storage-reduction-why-instabug-chose-clickhouse-for-apm"
source: "ClickHouse"
published: "2022-05-03"
difficulty: "medium"
kind: "Case study"
reading_minutes: 11
tags: ["analytics","observability","schema-migrations","databases","scalability"]
---

# 10x improved response times, cheaper to operate, and 30% storage reduction: why Instabug chose ClickHouse for APM

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2022-05-03, 11 min read, Case study. Original: [https://clickhouse.com/blog/10x-improved-response-times-cheaper-to-operate-and-30-storage-reduction-why-instabug-chose-clickhouse-for-apm](https://clickhouse.com/blog/10x-improved-response-times-cheaper-to-operate-and-30-storage-reduction-why-instabug-chose-clickhouse-for-apm)

## Summary

Instabug moved its mobile APM backend (about 3 billion events per day at roughly 2 million per minute) from Elasticsearch to self-managed ClickHouse after shard tuning and daily indexes failed to keep up with reads and writes. The migration took about five months behind a config-driven datastore abstraction that allowed dual writes and per-user rollout. Queries read only from pre-aggregated TO-form materialized views on top of ReplicatedMergeTree tables with date partitions, retention is done by dropping partitions, and writes go in through buffer tables. Lessons include avoiding NULLs and random UUID keys (which hurt compression), lowering materialized-view cardinality, and building their own histograms, a query layer and schema-migration automation. Reported results are roughly 10x faster responses, at least 30% less storage and fewer machines.

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)
- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [Schema migrations](https://swe.quest/tags/schema-migrations.md) (Data & databases)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)
- [Scaling](https://swe.quest/tags/scalability.md) (Distributed systems)

## Prerequisites

- columnar databases ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))
- Elasticsearch basics ([easy posts on Search](https://swe.quest/tags/search.md?difficulty=easy))
- SQL aggregations ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))

## Keywords

ClickHouse, Elasticsearch, ReplicatedMergeTree, materialized views, ZooKeeper, Instabug, MySQL

## Related posts

- [How HighLevel rebuilt its data platform for speed, scale, and simplicity on ClickHouse Cloud](https://swe.quest/articles/how-highlevel-rebuilt-its-data-platform-for-speed-scale-and-simplicity-on-826417013669e8fd.md): ClickHouse · 2026-01-12 · Medium · 8 min read · Analytics & OLAP, Databases, Scaling, Observability
  HighLevel replaced MySQL, Elasticsearch, Firestore and a document database with ClickHouse Cloud for lead activity, workflow logs, notifications and billing dashboards.
- [Ongage's Strategic Shift to ClickHouse for Real-time Email Marketing](https://swe.quest/articles/ongage-s-strategic-shift-to-clickhouse-for-real-time-email-marketing-dfca8e1a38de318e.md): ClickHouse · 2023-08-24 · Easy · 7 min read · Analytics & OLAP, MySQL, Databases, Cloud platforms
  Ongage, an email and SMS marketing automation company processing about half a billion messages a day, moved its campaign analytics and automation reporting from a large AWS RDS MySQL cluster (alongside MongoDB and Redshift) to ClickHouse Cloud.
- [How trip.com migrated from Elasticsearch and built a 50PB logging solution with ClickHouse](https://swe.quest/articles/how-trip-com-migrated-from-elasticsearch-and-built-a-50pb-logging-solution-with-079ade1f405efcf8.md): ClickHouse · 2024-06-12 · Medium · 16 min read · Analytics & OLAP, Observability, Scaling, Cost optimization, Databases
  Trip.com replaced its Elasticsearch-based centralized logging platform with ClickHouse after hitting stability, ingestion and cost limits at 4PB, and has since grown it toward 50PB.
- [Didi Migrates from Elasticsearch to ClickHouse for a new Generation Log Storage System](https://swe.quest/articles/didi-migrates-from-elasticsearch-to-clickhouse-for-a-new-generation-log-storage-50fcb56512cab39a.md): ClickHouse · 2024-04-19 · Medium · 11 min read · Analytics & OLAP, Observability, Storage engines, Scaling, Cost optimization
  Didi replaced Elasticsearch with ClickHouse for petabyte-per-day log and trace storage, cutting machine cost by 30% and speeding up queries about 4x on a 400+ node single-replica deployment peaking at 40 GB/s writes and ~200 QPS.
- [London Meetup Report: Scaling Analytics with PostHog and Introducing HouseWatch](https://swe.quest/articles/london-meetup-report-scaling-analytics-with-posthog-and-introducing-housewatch-ed6b50855ec52fa1.md): ClickHouse · 2023-07-05 · Medium · 4 min read · Analytics & OLAP, Performance engineering, Observability, Databases
  PostHog scaled its product analytics platform by moving from Postgres to ClickHouse, with an events table holding roughly 62 TB uncompressed for a single column.

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)
