Skip to content

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

ClickHouse 15 min read Case study mediumAdept

Building Real-time Analytics Apps with ClickHouse and Hex

ClickHouse's git-import tool was run across the 50k most-starred GitHub repositories using a queue-worker model, with the job queue implemented as a KeeperMap table instead of an external queue like SQS. New keeper_map_strict_mode settings make inserts unique per primary key and turn ALTER updates and deletes into atomic version-checked operations, so a worker can claim a job exclusively. All repositories share three ReplacingMergeTree tables keyed first on repo_name, with an updated_at materialized column used to schedule refreshes. On a 48-core machine with 25 workers, about 24 hours produced 44.7B line changes at a 14x compression ratio, which feed a Hex notebook app for real-time repository insights.

Assumes: ClickHouse MergeTree tablesSQL basicsjob queue concepts

Related posts

  • Data Hive: The story of beehiiv’s journey from Postgres to ClickHouse

    ClickHouse easyNovice

    beehiiv replaced its Postgres-and-Ruby-queue analytics system, which struggled with billions of email events and had multi-hour reporting delays, with a Kafka-fed ClickHouse Cloud pipeline. The design leans on ReplacingMergeTree for idempotent ingestion and event replay, dictionaries to enrich inserts without joins, ephemeral columns for intermediate calculations, materialized views as pre-aggregated shadow tables with alternate sort keys, and window functions for analytics. After six months the system held over 33 billion raw events in 1.5 TiB compressed (13 TiB uncompressed), with 22 ms median and 85 ms average query times. Creators now see send performance within seconds instead of hours.

  • How GitLab serves sub-second analytics to 50 million users

    ClickHouse easyNovice

    GitLab moved its user-facing product analytics from Postgres to ClickHouse after dashboards repeatedly hit its 15-second performance ceiling. Hierarchical multi-join queries over 100M+ rows dropped from 30–40 seconds to 0.24 seconds, and ClickHouse is now the default OLAP engine across GitLab.com, Dedicated and self-managed deployments. A hybrid data access layer routes queries between Postgres and ClickHouse, ingestion runs as TSV over HTTP plus an in-house CDC framework (Siphon), and materialized views are the main optimization tool. The team built and ran its own ClickHouse operator on object storage before moving SaaS to ClickHouse Cloud, and warns against self-managing unless required. It also flags poor visibility into background mutations as an ongoing operational pain.

  • How we built the Internal Data Warehouse at ClickHouse

    ClickHouse mediumAdept

    ClickHouse's internal data warehouse ingests tens of sources (Control Plane, Data Plane, AWS CUR, GCP billing, Salesforce, M3ter and others) into S3 hourly, then loads them into ClickHouse Cloud with the s3 table function and transforms them in SQL. Airflow schedules the work and Superset serves BI to about 100 users. Idempotency comes from ReplicatedReplacingMergeTree with FINAL plus re-runnable DAGs. Consistency comes from insert_quorum=3 rather than "auto", so inserts fail and retry during node restarts instead of leaving replicas incomplete. The team also found it needed a third intermediate business-entity layer beyond raw and mart, chose a single large transformation DAG over Airflow dataset triggers, and drives database-level access control from Google groups mapped to tables, columns and row filters.

  • Bonree replaces ZooKeeper with ClickHouse Keeper for drastically improved performance and reduced costs

    ClickHouse hardMaster

    Bonree migrated the coordination layer of its ClickHouse-based observability platform from five 3-node ZooKeeper clusters to a single ClickHouse Keeper cluster. The move cut CPU and memory use by more than 75% and improved performance nearly 8x, and it eliminated Java full-GC stalls and replica sync backlogs. The migration was automated with Ansible: ingestion and merges are stopped (e.g. SYSTEM STOP MERGES), fresh snapshots are taken and converted, then data is sampled and verified, bringing a 2-3 hour manual process down to minutes. Bonree also modified clickhouse-keeper-converter to merge snapshots from multiple ZooKeeper clusters into one, handled mixed ACL encryption states, and replaced slow ZooKeeper path reads with a path log, cutting verification of 9 million paths from about 9 hours to seconds.

  • NYC Meetup Report: Large Scale Financial Market Analytics with ClickHouse (Bloomberg)

    ClickHouse easyNovice

    Bloomberg's Structured Products team uses ClickHouse to power a Terminal application where a few users run interactive filter-and-group queries across roughly 100 million securities. The dataset is about 5 billion rows and 100 columns. Columnar storage keeps rarely used columns available without holding them in memory. The team prioritized ingestion over query speed: they build a new table for each change, such as adding a column, and stage data through buffer tables, which lets them load 4 TB in under an hour while keeping data fresh. Every query puts load on ZooKeeper, a single point of failure the team tests with disaster-recovery drills, and they plan to try Kubernetes, S3-backed storage and ClickHouse Keeper.

The quest for software engineering knowledge.

Look:
Layout: