---
title: "98% faster queries, 50% lower cloud costs: Verihubs’ journey from Postgres to ClickHouse"
description: "Verihubs rebuilt its data warehouse after a Postgres-based, daily-batch pipeline became slow, unreliable, and difficult to correct when late vendor callbacks required backfills. The new architecture uses Kafka, Kafka Connect, and Debezium for real-time ingestion into ClickHouse, with MergeTree for append-only logs and ReplacingMergeTree for datasets updated through change data capture. Materialized views create daily and monthly rollups, projections accelerate existing query patterns, and Dagster handles complex detection workflows that can notify Slack. The migration, completed in about six months, reduced query times from 20–30 minutes to two or three seconds on datasets up to 18 million rows, representing as much as 98% faster queries and 50% lower infrastructure costs. Verihubs says the resulting real-time OLAP system gives finance and operations fresher data for traffic analysis, reconciliation, performance reporting, and invoicing."
---

# 98% faster queries, 50% lower cloud costs: Verihubs’ journey from Postgres to ClickHouse

[Clickhouse](https://yomu.fyi/company/clickhouse) · Jul 6, 2026

**Type:** Problem & solution

## Summary

Verihubs rebuilt its data warehouse after a Postgres-based, daily-batch pipeline became slow, unreliable, and difficult to correct when late vendor callbacks required backfills. The new architecture uses Kafka, Kafka Connect, and Debezium for real-time ingestion into ClickHouse, with MergeTree for append-only logs and ReplacingMergeTree for datasets updated through change data capture. Materialized views create daily and monthly rollups, projections accelerate existing query patterns, and Dagster handles complex detection workflows that can notify Slack. The migration, completed in about six months, reduced query times from 20–30 minutes to two or three seconds on datasets up to 18 million rows, representing as much as 98% faster queries and 50% lower infrastructure costs. Verihubs says the resulting real-time OLAP system gives finance and operations fresher data for traffic analysis, reconciliation, performance reporting, and invoicing.

## Context

Verihubs’ Postgres warehouse relied on daily Airflow pulls from an OLTP system. Processing could take two to six hours, time out, or fail, while late vendor callbacks caused incorrect invoices and required backfills that made Postgres queries extremely slow. Stakeholders needed more timely and dependable data for traffic analysis, reconciliation, performance reporting, and invoicing.

## Approach / What changed

Verihubs moved the warehouse to ClickHouse and split the design into streaming ingestion and post-processing. Kafka, Kafka Connect, and Debezium provide real-time ingestion, retries, and change data capture. Append-only data uses MergeTree tables, while updated datasets use ReplacingMergeTree. Materialized views and projections accelerate analytical access, and Dagster handles complex detection workflows and notifications.

## Takeaways

- Kafka buffering gives Verihubs a retry mechanism for ingestion, avoiding direct writes to ClickHouse that could be affected by timeouts or failed inserts.
- Materialized views produce daily and monthly rollups, while projections speed stakeholder queries without requiring changes to the tables they already query.
- ClickHouse mutations are applied gradually, so updates and deletes may not become visible immediately; backfills and cascading materialized views require advance planning.

**Tags:** [Architecture](https://yomu.fyi/topic/architecture), [Data Pipelines](https://yomu.fyi/topic/data-pipelines), [Kafka](https://yomu.fyi/topic/kafka), [Performance](https://yomu.fyi/topic/performance), [Postgres](https://yomu.fyi/topic/postgres)

- Source: [Clickhouse](https://clickhouse.com/blog/verihubs-data-warehouse)
- Source URL: https://clickhouse.com/blog/verihubs-data-warehouse
- Ingested by Yomu: 2026-08-29T01:37:53.079Z

[Read original post](https://clickhouse.com/blog/verihubs-data-warehouse)
