Skip to content

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

ClickHouse 6 min read Opinion easyNovice

OLTP is expensive, you can ClickHouse it.

Data that has stopped changing doesn't need Postgres's ACID machinery, so it can be offloaded to ClickHouse for roughly an order of magnitude better unit economics. Postgres pays for durability, MVCC isolation and synchronous index maintenance on every write: a ~100-byte change touches several 8 KB pages and tens of KB of WAL. It also stores data in uncompressed row pages that thrash the cache once data outgrows RAM. The proposed pattern keeps writes and fresh-row reads in Postgres and replicates settled data to ClickHouse via CDC to serve reads and aggregations, with claimed 10–30× compression and ~100× cheaper aggregations. The cost is slower single-row reads and about a second of eventual consistency. ClickHouse Cloud features (NVMe Postgres, WalShadow CDC, the pg_clickhouse FDW) are pitched as the way to implement it.

Related posts

  • Longbridge Technology simplifies their architecture and achieves 10x performance boost with ClickHouse

    ClickHouse mediumAdept

    Longbridge, a Singapore online brokerage, replaced a fragmented market-data stack of PostgreSQL (historical), Redis (real-time) and DynamoDB (high-write) with ClickHouse after evaluating it against TimescaleDB and TDengine for write throughput, Decimal support, time functions and aggregations. Historical data was migrated via ClickHouse external tables over OSS and Alibaba Cloud DTS, which merged 128 PostgreSQL sub-tables into one table and converted varchar fields to Decimal; Redis was kept for real-time data with ticker-level writes moved to ClickHouse. Reported results include about 5x compression (500GB down to 100GB), 10x faster single-table writes than PostgreSQL, and built-in aggregation and window functions replacing scheduled statistics jobs.

  • Postgres at Open House NYC

    ClickHouse easyNovice

    ClickHouse used its Open House NYC keynote to launch WalShadow, an open-source engine that replicates Postgres into ClickHouse from the physical WAL instead of logical replication. It decodes WAL outside the source and uses a schema-only shadow Postgres to track DDL, effectively making ClickHouse an analytical physical standby. On 8-vCPU instances it showed about 200 ms commit-to-visible latency and 300K rows/s, versus about 10 s and 120K rows/s for PeerDB. The keynote also opened a Google Cloud private preview of ClickHouse Managed Postgres and released a chdb Postgres extension that extends COPY to import from S3, GCS and Azure and outperformed DuckDB-based extensions on the NYC Taxi import benchmark.

  • Vantage's Journey from Redshift and Postgres to ClickHouse

    ClickHouse easyNovice

    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. Redshift, tried next with Postgres as a cache, struggled with updates, needed data inserted in sort order, required expensive vacuum sort jobs, and forced billions of rows to be copied daily between the two systems. A 60-day migration to ClickHouse Cloud replaced the delete-and-reinsert pattern with ReplacingMergeTree and an incrementing import-version column, letting background merges handle updates. The result was double the resources at roughly Redshift's price, with query performance comparable to well-indexed pre-aggregated Postgres tables.

  • How Socialpruf built a faster, more reliable data stack by replacing Neon with Postgres managed by ClickHouse

    ClickHouse easyNovice

    Socialpruf, a social analytics platform ingesting hundreds of posts per second, moved customer-facing dashboard queries from Postgres to ClickHouse via CDC, cutting multi-second load times to millisecond aggregations. It later migrated its 0.5 TB Postgres from Neon to Postgres managed by ClickHouse. The drivers were Neon connection dropouts and cross-service network transfer charges exceeding half of compute cost. After a failed logical-replication attempt, PeerDB mirrored the data in hours and was validated for a week before cutover, and PgBouncer absorbed thousands of connections that exceeded max_connections. Reported results are about 30% faster Postgres queries overall (up to 5x on some) and no connectivity issues since the switch.

  • PostgreSQL + ClickHouse as the Open Source unified data stack

    ClickHouse easyNovice

    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.

The quest for software engineering knowledge.

Look:
Layout: