---
title: "98% faster queries, 50% lower cloud costs: Verihubs’ journey from Postgres to ClickHouse"
description: "Verihubs replaced a Postgres warehouse fed by daily Airflow batch pulls with a ClickHouse-based real-time OLAP stack."
url: "https://swe.quest/articles/98-faster-queries-50-lower-cloud-costs-verihubs-journey-from-postgres-to-f6535061aff525b1"
canonical: "https://clickhouse.com/blog/verihubs-data-warehouse"
source: "ClickHouse"
published: "2026-07-06"
difficulty: "medium"
kind: "Case study"
reading_minutes: 6
tags: ["analytics","data-pipelines","postgres","event-driven"]
---

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

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2026-07-06, 6 min read, Case study. Original: [https://clickhouse.com/blog/verihubs-data-warehouse](https://clickhouse.com/blog/verihubs-data-warehouse)

## Summary

Verihubs replaced a Postgres warehouse fed by daily Airflow batch pulls with a ClickHouse-based real-time OLAP stack. Kafka Connect and Debezium CDC stream data into MergeTree tables for append-only logs and ReplacingMergeTree tables for updatable rows. Materialized views and projections build daily and monthly rollups for reconciliation and invoicing, and Dagster handles complex detection jobs. Queries dropped from 20-30 minutes to 2-3 seconds, and cloud costs fell up to 50%. Lessons include designing ordering keys up front, choosing MergeTree engines carefully, expecting asynchronous mutations, and planning backfills because materialized views don't backfill automatically.

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)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Event-driven architecture](https://swe.quest/tags/event-driven.md) (Backend & APIs)

## Prerequisites

- OLAP vs OLTP databases ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- Kafka basics ([easy posts on Queues & messaging](https://swe.quest/tags/messaging.md?difficulty=easy))
- change data capture

## Keywords

ClickHouse, PostgreSQL, Kafka Connect, Debezium, ReplacingMergeTree, Dagster, Airflow, Metabase

## Related posts

- [“Just OLAP it”: How Ramp rebuilt its analytics platform on ClickHouse Cloud](https://swe.quest/articles/just-olap-it-how-ramp-rebuilt-its-analytics-platform-on-clickhouse-cloud-36298842faab88cc.md): ClickHouse · 2026-01-20 · Medium · 5 min read · Analytics & OLAP, Event-driven architecture, Data pipelines, PostgreSQL, Queues & messaging
  Ramp moved customer-facing spend analytics off its Postgres monolith after enterprise customers' reports on a single card-transactions table began taking 40+ seconds, and now serves them in milliseconds from ClickHouse Cloud.
- [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.
- [Ongage's Strategic Shift to ClickHouse for Real-time Email Marketing](https://swe.quest/articles/ongage-s-strategic-shift-to-clickhouse-for-real-time-email-marketing-dfca8e1a38de318e.md): ClickHouse · 2023-08-24 · Easy · 7 min read · Analytics & OLAP, MySQL, Databases, Cloud platforms
  Ongage, an email and SMS marketing automation company processing about half a billion messages a day, moved its campaign analytics and automation reporting from a large AWS RDS MySQL cluster (alongside MongoDB and Redshift) to ClickHouse Cloud.
- [How SewerAI is using ClickHouse to modernize sewer management at scale](https://swe.quest/articles/how-sewerai-is-using-clickhouse-to-modernize-sewer-management-at-scale-b730a0ec357c6359.md): ClickHouse · 2025-09-19 · Medium · 7 min read · Analytics & OLAP, Data pipelines, Performance engineering, Cost optimization, PostgreSQL
  SewerAI replicates its Postgres transactional data into ClickHouse via CDC (moving from Confluent/Debezium to self-hosted Debezium+Kinesis to PeerDB, and now ClickPipes) and uses materialized and refreshable materialized views to denormalize 40+ tables into a single hundreds-of-billions-row "Megatable" for real-time municipal analytics.
- [Vantage's Journey from Redshift and Postgres to ClickHouse](https://swe.quest/articles/vantage-s-journey-from-redshift-and-postgres-to-clickhouse-3bbe2f8581aa24cf.md): ClickHouse · 2023-07-13 · Easy · 5 min read · Analytics & OLAP, PostgreSQL, Databases, Cost optimization
  Vantage, a cloud cost platform handling billions of billing records, outgrew Postgres when constant deletes and reinserts kept vacuum running and pushed indexes out of memory.

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)
