Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 4 min read Case study easyNovice

How Rokt Achieved Real-time Reporting with ClickHouse

Rokt replaced an Elasticsearch-backed reporting layer with ClickHouse. Elasticsearch lacked flexible group-by and filtering, had no S3 loading or joins, required JSON queries, and forced full re-ingestion whenever a label changed. After ruling out Pinot, Druid, Snowflake, StarRocks and Citus, the team benchmarked ClickHouse against Redshift: ClickHouse was about 3x cheaper, handled up to 200 queries per second with a maximum query time of six seconds, and stored 500 GB of gzipped Parquet in roughly the same space, about one sixth of the Elasticsearch footprint. The current self-managed setup runs ClickHouse in an autoscaling group with ZooKeeper behind network load balancers, and Rokt plans to move to ClickHouse Cloud to offload replication, sharding and backups.

Related posts

  • Contentsquare Migration from Elasticsearch to ClickHouse

    ClickHouse mediumAdept

    Contentsquare replaced 14 Elasticsearch clusters with ClickHouse over a phased migration. They first built a new product on ClickHouse, then shadowed production queries endpoint by endpoint to compare results, then moved customers one at a time over six months with zero regressions. The result was 11x lower infrastructure cost, 10x better p99 latency, and longer query windows and retention. Key design pieces were a Kafka-fed ingestion service (clickin) that writes shard-aligned data in ClickHouse native format via clickhouse-local, and an AST-based query optimizer that propagates partition/sort-key conditions and distributed_group_by_no_merge, merges subqueries, and gave a 10x speedup on the slowest 5% of queries.

  • Do you still need Elasticsearch for log analytics? ClickHouse says no.

    ClickHouse mediumAdept

    ClickHouse's redesigned inverted-index full-text search feeds matches directly into its vectorized analytical engine, and on a reproducible OpenTelemetry log benchmark at 1B, 10B and 50B rows it ran a nine-query search-plus-aggregation suite 2-6x faster than Elasticsearch, with a much smaller storage footprint. Both systems ran single-node on identical m6i.8xlarge instances with matching sort orders, result caches disabled, and cold and hot runs measured separately. Elasticsearch was tested with Query DSL, which was faster than ES|QL. The storage gap comes from ClickHouse's per-column general-purpose compression and from Elasticsearch's need to keep _source and stored fields. Ingesting 50B rows took under 4 hours in ClickHouse versus about 5 days in a tuned Elasticsearch setup.

  • Why m3ter chose ClickHouse Cloud

    ClickHouse mediumAdept

    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. Usage events had to stay unaggregated so bills could be recalculated after retrospective config changes. The tests scored each database on ingest rate, deduplication, query concurrency, export, deletion, scalability and cost. ClickHouse delivered 10x ingest, 17x QPS, 11.4x compression, sub-100ms queries (144ms vs Redshift's 3927ms at similar cost) and ~85% cost savings. Its weak spots were deduplication, which relies on background merges or FINAL and so needs pre-insert dedup, and heavier deletes than OLTP stores.

  • SIEM made simpler: How Huntress improved performance and slashed costs with ClickHouse

    ClickHouse mediumAdept

    Huntress rebuilt its SIEM on ClickHouse Cloud after finding Elasticsearch too expensive (over $70,000/month) and Postgres too awkward to scale. A comparable ClickHouse workload costs about $5,000/month. Logs from Rails services and other sources pass through Vector, which batches them and inserts over HTTP at up to 200,000 records per second. Their lessons: use ClickHouse partitions for lifecycle management such as TTL rather than per-tenant sharding, choose the sorting key (tenant ID first) carefully up front because it drives performance and is hard to change later, and don't expect data skipping indexes to behave like Postgres secondary indexes.

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

    ClickHouse mediumAdept

    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.

The quest for software engineering knowledge.

Look:
Layout: