---
title: "Didi Migrates from Elasticsearch to ClickHouse for a new Generation Log Storage System"
description: "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."
url: "https://swe.quest/articles/didi-migrates-from-elasticsearch-to-clickhouse-for-a-new-generation-log-storage-50fcb56512cab39a"
canonical: "https://clickhouse.com/blog/didi-migrates-from-elasticsearch-to-clickHouse-for-a-new-generation-log-storage-system"
source: "ClickHouse"
published: "2024-04-19"
difficulty: "medium"
kind: "Case study"
reading_minutes: 11
tags: ["analytics","observability","storage-engines","scalability","cost-optimization"]
---

# Didi Migrates from Elasticsearch to ClickHouse for a new Generation Log Storage System

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2024-04-19, 11 min read, Case study. Original: [https://clickhouse.com/blog/didi-migrates-from-elasticsearch-to-clickHouse-for-a-new-generation-log-storage-system](https://clickhouse.com/blog/didi-migrates-from-elasticsearch-to-clickHouse-for-a-new-generation-log-storage-system)

## Summary

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. A single Flink write pipeline feeds a Log cluster, and materialized views populate a physically isolated Trace cluster plus AggregatingMergeTree trace index tables, with cold data tiered to HDFS. Schema design rounds log time to the hour as the leading sort key, partitions by day, and moves unfiltered fields into Map columns to limit small files. Operational fixes covered per-table write-node allocation for low-traffic tables, Flink-side throttling, a native TCP Flink connector, and HDFS tiering changes that cut restart time from 1 hour to 1 minute.

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)
- [Storage engines](https://swe.quest/tags/storage-engines.md) (Data & databases)
- [Scaling](https://swe.quest/tags/scalability.md) (Distributed systems)
- [Cost optimization](https://swe.quest/tags/cost-optimization.md) (Reliability & operations)

## Prerequisites

- ClickHouse MergeTree basics ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- materialized views
- log storage concepts

## Keywords

ClickHouse, Elasticsearch, Flink, HDFS, AggregatingMergeTree, Pulsar, libhdfs3

## Related posts

- [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.
- [Contentsquare Migration from Elasticsearch to ClickHouse](https://swe.quest/articles/contentsquare-migration-from-elasticsearch-to-clickhouse-052c118198db3e2f.md): ClickHouse · 2022-10-11 · Medium · 6 min read · Analytics & OLAP, Refactoring & migrations, Distributed databases, Performance engineering, Cost optimization
  Contentsquare replaced 14 Elasticsearch clusters with ClickHouse over a phased migration.
- [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.
- [SIEM made simpler: How Huntress improved performance and slashed costs with ClickHouse](https://swe.quest/articles/siem-made-simpler-how-huntress-improved-performance-and-slashed-costs-with-0c0de3a6602cf479.md): ClickHouse · 2024-11-19 · Medium · 6 min read · Analytics & OLAP, Threat detection, Data pipelines, Cost optimization
  Huntress rebuilt its SIEM on ClickHouse Cloud after finding Elasticsearch too expensive (over $70,000/month) and Postgres too awkward to scale.
- [How we Built a 19 PiB Logging Platform with ClickHouse and Saved Millions](https://swe.quest/articles/how-we-built-a-19-pib-logging-platform-with-clickhouse-and-saved-millions-5704529f91592f0b.md): ClickHouse · 2024-04-02 · Medium · 32 min read · Observability, Analytics & OLAP, Cost optimization, Scaling, System design
  ClickHouse replaced Datadog for internal logging with LogHouse, a per-region ClickHouse deployment holding over 19 PiB uncompressed (37 trillion rows) for its AWS regions.

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)
