---
title: "Building Real-time Analytics Apps with ClickHouse and Hex"
description: "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."
url: "https://swe.quest/articles/building-real-time-analytics-apps-with-clickhouse-and-hex-28d6bbb0cc85e5a5"
canonical: "https://clickhouse.com/blog/building-real-time-applications-with-clickhouse-and-hex-notebook-keeper-engine"
source: "ClickHouse"
published: "2023-04-07"
difficulty: "medium"
kind: "Case study"
reading_minutes: 15
tags: ["analytics","data-pipelines","scheduling","consistency"]
---

# Building Real-time Analytics Apps with ClickHouse and Hex

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2023-04-07, 15 min read, Case study. Original: [https://clickhouse.com/blog/building-real-time-applications-with-clickhouse-and-hex-notebook-keeper-engine](https://clickhouse.com/blog/building-real-time-applications-with-clickhouse-and-hex-notebook-keeper-engine)

## Summary

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.

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)
- [Data pipelines](https://swe.quest/tags/data-pipelines.md) (Data & databases)
- [Scheduling](https://swe.quest/tags/scheduling.md) (Distributed systems)
- [Consistency models](https://swe.quest/tags/consistency.md) (Distributed systems)

## Prerequisites

- ClickHouse MergeTree tables ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- SQL basics ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- job queue concepts

## Keywords

ClickHouse, Hex, KeeperMap, ClickHouse Keeper, git-import, ReplacingMergeTree, ClickHouse Cloud, GitHub Events

## Related posts

- [Data Hive: The story of beehiiv’s journey from Postgres to ClickHouse](https://swe.quest/articles/data-hive-the-story-of-beehiiv-s-journey-from-postgres-to-clickhouse-467867cb2bebb87b.md): ClickHouse · 2024-08-21 · Easy · 6 min read · Analytics & OLAP, Databases, PostgreSQL, Stream processing, Queues & messaging
  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.
- [How GitLab serves sub-second analytics to 50 million users](https://swe.quest/articles/how-gitlab-serves-sub-second-analytics-to-50-million-users-cabf627f25c869fd.md): ClickHouse · 2025-10-21 · Easy · 10 min read · Analytics & OLAP, PostgreSQL, Databases, Scaling
  GitLab moved its user-facing product analytics from Postgres to ClickHouse after dashboards repeatedly hit its 15-second performance ceiling.
- [How we built the Internal Data Warehouse at ClickHouse](https://swe.quest/articles/how-we-built-the-internal-data-warehouse-at-clickhouse-d3d7520881242252.md): ClickHouse · 2023-07-19 · Medium · 16 min read · Analytics & OLAP, Data pipelines, System design, Identity & auth, Scheduling
  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.
- [Bonree replaces ZooKeeper with ClickHouse Keeper for drastically improved performance and reduced costs](https://swe.quest/articles/bonree-replaces-zookeeper-with-clickhouse-keeper-for-drastically-improved-6eee02db0b20c225.md): ClickHouse · 2024-07-22 · Hard · 11 min read · Analytics & OLAP, Consensus, Distributed systems, Observability, Cost optimization
  Bonree migrated the coordination layer of its ClickHouse-based observability platform from five 3-node ZooKeeper clusters to a single ClickHouse Keeper cluster.
- [NYC Meetup Report: Large Scale Financial Market Analytics with ClickHouse (Bloomberg)](https://swe.quest/articles/nyc-meetup-report-large-scale-financial-market-analytics-with-clickhouse-269ed023b1feda87.md): ClickHouse · 2022-12-06 · Easy · 3 min read · Analytics & OLAP, Databases, Payments & fintech
  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.

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)
