---
title: "PostgreSQL + ClickHouse as the Open Source unified data stack"
description: "An open source stack pairs PostgreSQL as the transactional system of record with ClickHouse for analytics, connected by PeerDB for change data capture and the pg_clickhouse extension, which transparently offloads analytical queries from Postgres to ClickHouse."
url: "https://swe.quest/articles/postgresql-clickhouse-as-the-open-source-unified-data-stack-2760f19ba52907df"
canonical: "https://clickhouse.com/blog/postgres-clickhouse-oss"
source: "ClickHouse"
published: "2026-01-27"
difficulty: "easy"
kind: "Announcement"
reading_minutes: 5
tags: ["postgres","analytics","event-driven","replication"]
---

# PostgreSQL + ClickHouse as the Open Source unified data stack

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2026-01-27, 5 min read, Announcement. Original: [https://clickhouse.com/blog/postgres-clickhouse-oss](https://clickhouse.com/blog/postgres-clickhouse-oss)

## Summary

An open source stack pairs PostgreSQL as the transactional system of record with ClickHouse for analytics, connected by PeerDB for change data capture and the pg\_clickhouse extension, which transparently offloads analytical queries from Postgres to ClickHouse. Two patterns are described: CDC replication for operational analytics on application data, and split-writes for high-volume logs, metrics and events that never need to live in Postgres. Adopting it involves creating a ClickHouse database, replicating via PeerDB, configuring pg\_clickhouse and pointing queries at its tables, so application changes stay minimal. A managed version in ClickHouse Cloud swaps PeerDB for ClickPipes and preinstalls the extension.

Written by swe.quest, not by the author.

**Difficulty:** Easy: no special background needed; explains what something is and why it matters

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Event-driven architecture](https://swe.quest/tags/event-driven.md) (Backend & APIs)
- [Replication](https://swe.quest/tags/replication.md) (Distributed systems)

## Prerequisites

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

## Keywords

PostgreSQL, ClickHouse, PeerDB, pg\_clickhouse, ClickPipes, ClickHouse Cloud

## Related posts

- [Postgres Meets Analytics: CDC From Neon to ClickHouse Via PeerDB](https://swe.quest/articles/postgres-meets-analytics-cdc-from-neon-to-clickhouse-via-peerdb-669fe8e963909dd5.md): Neon · 2024-10-02 · Medium · 5 min read · PostgreSQL, Event-driven architecture, Analytics & OLAP, Replication, Data pipelines
  Neon serverless Postgres can serve as the transactional system of record while ClickHouse handles real-time analytics, with PeerDB streaming changes between them via Postgres logical replication.
- [Postgres CDC in ClickHouse, A year in review](https://swe.quest/articles/postgres-cdc-in-clickhouse-a-year-in-review-6b9d350bcade98d4.md): ClickHouse · 2025-12-03 · Medium · 13 min read · PostgreSQL, Event-driven architecture, Data pipelines, Analytics & OLAP, Replication
  A year after PeerDB's acquisition, Postgres CDC into ClickHouse via ClickPipes has grown to 400+ companies replicating over 200 TB per month, driven by real-time customer-facing analytics and data warehousing workloads.
- [Change Data Capture (CDC) with PostgreSQL and ClickHouse - Part 1](https://swe.quest/articles/change-data-capture-cdc-with-postgresql-and-clickhouse-part-1-10e3d601e2748dab.md): ClickHouse · 2023-06-15 · Medium · 23 min read · Event-driven architecture, PostgreSQL, Analytics & OLAP, Replication, Queues & messaging
  Postgres-to-ClickHouse CDC can be built by streaming row changes from Postgres logical decoding (pgoutput plugin, replication slots, LSN ordering) through Debezium and Kafka, then applying them in ClickHouse with the ReplacingMergeTree engine.
- [Change Data Capture (CDC) with PostgreSQL and ClickHouse - Part 2](https://swe.quest/articles/change-data-capture-cdc-with-postgresql-and-clickhouse-part-2-2123f803752f2e9d.md): ClickHouse · 2023-06-15 · Medium · 22 min read · Event-driven architecture, PostgreSQL, Analytics & OLAP, Data pipelines, Replication
  A Postgres-to-ClickHouse CDC pipeline is built with Debezium, Kafka Connect and a ClickHouse materialized view, keeping a ReplacingMergeTree table in sync with the 28M-row UK property price dataset under a mix of inserts, updates and deletes.
- [A universal interface: How QuintoAndar made ClickHouse plug-and-play with managed Postgres](https://swe.quest/articles/a-universal-interface-how-quintoandar-made-clickhouse-plug-and-play-with-ec413a5dd96fc04f.md): ClickHouse · 2026-08-27 · Easy · 6 min read · Analytics & OLAP, PostgreSQL, Data pipelines, System design
  QuintoAndar's customer data platform replaced a Lambda architecture (a Postgres hot layer plus Kafka Connect into a Delta landing zone processed by 24/7 Databricks jobs with costly MERGE INTO deduplication) by having its event gateway write about 900 million monthly events directly into ClickHouse Cloud, which also serves roughly 300 million API requests a month with sub-second reads.

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)
