Skip to content

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

ClickHouse 5 min read Case study mediumAdept

Collecting Semi-structured Data from Kafka Topics Using ClickHouse Kafka Engine

Superology, a sports-betting product company, ingests clickstream and other customer quantitative data into ClickHouse straight from Kafka using the Kafka table engine with the Protobuf input format. Events are batched into a single proto message that uses oneof fields for varying event types. Schemas evolve only by adding fields, which keeps them backward compatible; origin table columns are added with ALTER TABLE, and dropped fields are deprecated rather than removed. Materialized views filter and transform the data for funnels, segmentation and dashboards, tiered storage moves older data to S3, and built-in statistical functions such as welchTTest and mannWhitneyUTest support A/B and Bayesian experimentation.

Related posts

  • DeepL’s journey with ClickHouse

    ClickHouse easyNovice

    DeepL runs ClickHouse as its central data warehouse for web and app analytics, company metrics, A/B testing and ML personalization. They chose it in 2020 over Hadoop for its easy single-binary deployment and built an MVP pipeline of event API, Kafka, a sink into ClickHouse, and Metabase. Protobuf event definitions serve as the single source of truth: APIs use them to validate events, sinks use them to diff and migrate table schemas automatically, and they generate event documentation. The deployment grew from a single node to 3 shards × 3 replicas ingesting about half a billion rows per day, and ClickHouse array functions simplified the statistics for users exposed to many concurrent experiments.

  • Streamkap: An out-of-the-box CDC solution for ClickHouse

    ClickHouse mediumAdept

    Streamkap's ClickHouse connector streams change data capture from PostgreSQL, MySQL, SQL Server, Oracle and MongoDB into ClickHouse using Kafka, Debezium and Flink. It maps Kafka Connect types, including nested structs and arrays, to ClickHouse types such as Tuple and Array, and adds metadata columns like op type, source timestamp and delete flag to every row. Append mode writes every change to MergeTree tables, while the default upsert mode uses ReplacingMergeTree keyed on the event timestamp and a delete flag, so queries need FINAL to get deduplicated results. The post also covers handling inconsistent semi-structured source data and choosing between blocking and incremental snapshots for the initial load.

  • 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.

  • Real-time event streaming with ClickHouse, Confluent Cloud and ClickPipes

    ClickHouse mediumAdept

    ClickPipes, a managed Kafka ingestion service in ClickHouse Cloud, replaces the ClickHouse Kafka Connector in a pipeline that streams Google's public Ethereum dataset from Pub/Sub through Confluent Cloud into ClickHouse. The pipeline evolved from a batch BigQuery-to-GCS export with about 30 minutes of delay, to a Pub/Sub-to-Kafka stream about 4 minutes behind the chain, and now ClickHouse pulls directly from the Kafka topics. One ClickPipe per topic lands raw JSON into message tables, and materialized views using JSONExtract populate typed MergeTree tables. Configuration tips cover using the Confluent API key as credentials, setting a unique consumer group and supplying the bootstrap endpoint.

  • 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: