---
title: "Collecting Semi-structured Data from Kafka Topics Using ClickHouse Kafka Engine"
description: "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."
url: "https://swe.quest/articles/collecting-semi-structured-data-from-kafka-topics-using-clickhouse-kafka-engine-3d9b1ad5e7d388c2"
canonical: "https://clickhouse.com/blog/collecting-semi-structured-data-from-kafka-topics-using-clickhouse-kafka-engine"
source: "ClickHouse"
published: "2022-06-15"
difficulty: "medium"
kind: "Case study"
reading_minutes: 5
tags: ["analytics","messaging","data-pipelines","schema-migrations"]
---

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

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2022-06-15, 5 min read, Case study. Original: [https://clickhouse.com/blog/collecting-semi-structured-data-from-kafka-topics-using-clickhouse-kafka-engine](https://clickhouse.com/blog/collecting-semi-structured-data-from-kafka-topics-using-clickhouse-kafka-engine)

## Summary

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.

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)
- [Queues & messaging](https://swe.quest/tags/messaging.md) (Backend & APIs)
- [Data pipelines](https://swe.quest/tags/data-pipelines.md) (Data & databases)
- [Schema migrations](https://swe.quest/tags/schema-migrations.md) (Data & databases)

## Prerequisites

- Kafka basics ([easy posts on Queues & messaging](https://swe.quest/tags/messaging.md?difficulty=easy))
- Protocol Buffers
- ClickHouse materialized views ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))

## Keywords

ClickHouse, Kafka, Protocol Buffers, ClickHouse Kafka engine, MindsDB, S3

## Related posts

- [DeepL’s journey with ClickHouse](https://swe.quest/articles/deepl-s-journey-with-clickhouse-66b4fb32110b2db8.md): ClickHouse · 2022-07-26 · Easy · 4 min read · Analytics & OLAP, Data pipelines, Schema migrations, Queues & messaging
  DeepL runs ClickHouse as its central data warehouse for web and app analytics, company metrics, A/B testing and ML personalization.
- [Streamkap: An out-of-the-box CDC solution for ClickHouse](https://swe.quest/articles/streamkap-an-out-of-the-box-cdc-solution-for-clickhouse-fb75535a3b94ad24.md): ClickHouse · 2024-02-22 · Medium · 14 min read · Event-driven architecture, Analytics & OLAP, Data pipelines, Schema migrations
  Streamkap's ClickHouse connector streams change data capture from PostgreSQL, MySQL, SQL Server, Oracle and MongoDB into ClickHouse using Kafka, Debezium and Flink.
- [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.
- [Real-time event streaming with ClickHouse, Confluent Cloud and ClickPipes](https://swe.quest/articles/real-time-event-streaming-with-clickhouse-confluent-cloud-and-clickpipes-879faea273bbaac2.md): ClickHouse · 2023-07-20 · Medium · 7 min read · Stream processing, Queues & messaging, Analytics & OLAP, Data pipelines
  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.
- [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)
