---
title: "How trip.com migrated from Elasticsearch and built a 50PB logging solution with ClickHouse"
description: "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."
url: "https://swe.quest/articles/how-trip-com-migrated-from-elasticsearch-and-built-a-50pb-logging-solution-with-079ade1f405efcf8"
canonical: "https://clickhouse.com/blog/how-trip.com-migrated-from-elasticsearch-and-built-a-50pb-logging-solution-with-clickhouse"
source: "ClickHouse"
published: "2024-06-12"
difficulty: "medium"
kind: "Case study"
reading_minutes: 16
tags: ["analytics","observability","scalability","cost-optimization","databases"]
---

# How trip.com migrated from Elasticsearch and built a 50PB logging solution with ClickHouse

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2024-06-12, 16 min read, Case study. Original: [https://clickhouse.com/blog/how-trip.com-migrated-from-elasticsearch-and-built-a-50pb-logging-solution-with-clickhouse](https://clickhouse.com/blog/how-trip.com-migrated-from-elasticsearch-and-built-a-50pb-logging-solution-with-clickhouse)

## Summary

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. The migration used a ReplicatedMergeTree schema with daily partitions, ZSTD codecs, LowCardinality columns, tag key/value arrays and tokenbf\_v1 bloom-filter indexes. Kibana was extended with custom ClickHouse panels, and scripts migrated 95% of dashboards automatically. The result was over 50% storage savings and queries 4–30x faster (P90 under 300ms). Further growth caused ZooKeeper-driven DDL timeouts, which led trip.com to split into multiple clusters and to evaluate ClickHouse Cloud with SharedMergeTree.

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

## Prerequisites

- Elasticsearch cluster architecture ([easy posts on Search](https://swe.quest/tags/search.md?difficulty=easy))
- ClickHouse MergeTree tables ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- Kafka log ingestion ([easy posts on Queues & messaging](https://swe.quest/tags/messaging.md?difficulty=easy))

## Keywords

ClickHouse, Elasticsearch, Kibana, Kafka, gohangout, SharedMergeTree, ZooKeeper, ClickHouse Keeper

## Related posts

- [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.
- [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.
- [Our New Observability Platform for 100B Logs](https://swe.quest/articles/our-new-observability-platform-for-100b-logs-ffdc8340b285c59b.md): Railway · 2023-09-29 · Medium · 7 min read · Observability, Analytics & OLAP, Replication, Scaling
  Railway rebuilt its logging backend on ClickHouse to power Log Explorer, handling about 1 billion new logs per day, 100 billion stored logs and 60 queries/sec at roughly 50ms average latency on a 2-shard/2-replica cluster.
- [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.
- [Why Front migrated from Elasticsearch to ClickHouse for “pixel-perfect” analytics at scale](https://swe.quest/articles/why-front-migrated-from-elasticsearch-to-clickhouse-for-pixel-perfect-analytics-882b7386f623bf53.md): ClickHouse · 2026-11-18 · Easy · 7 min read · Analytics & OLAP, Databases, Developer productivity
  Front moved customer-facing analytics for 9,000+ B2B companies off a 200-node, 25 TB Elasticsearch cluster and onto ClickHouse Cloud.

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)
