Skip to content

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

ClickHouse 16 min read How-to mediumAdept

Adding Real Time Analytics to a Supabase Application With ClickHouse

HouseClick, a demo estate-agency app, keeps ~1000 current listings in Supabase Postgres and serves analytics over the ~30M-row UK house price dataset from ClickHouse Cloud. The app first queried ClickHouse directly via its JS client, then switched to Supabase's ClickHouse Foreign Data Wrapper so Postgres pushes queries down to ClickHouse and returns only aggregated results. That gives developers a single SQL interface and lets them join transactional and analytical data without ETL. The post also contrasts OLTP and OLAP workloads and walks through FDW setup, best practices, and options for syncing transactional data into ClickHouse.

Related posts

  • 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.

  • ClickHouse Partnership, improved Postgres Replication, and Disk Management

    Supabase mediumAdept

    Supabase and ClickHouse are partnering around a Postgres-for-transactions, ClickHouse-for-analytics stack that is becoming common among AI companies. The Supabase ClickHouse foreign data wrapper now supports ClickHouse parameterized views, so query parameters can be passed from Postgres into ClickHouse. Thirteen Postgres replication and memory parameters, including max_slot_wal_keep_size and max_wal_size, are now configurable through the CLI. This targets PeerDB CDC pipelines, where the default 1GB WAL limit could cause data loss. Disk space can also be split between database and WAL, for example 6GB/2GB on the Pro plan.

  • A universal interface: How QuintoAndar made ClickHouse plug-and-play with managed Postgres

    ClickHouse easyNovice

    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. Hightouch's Customer Studio doesn't support ClickHouse as a source, so the team put ClickHouse Managed Postgres in front of it. The pg_clickhouse extension exposes ClickHouse tables as foreign tables, pushes joins and aggregations down to ClickHouse, and keeps Hightouch's Lightning Sync state tables in Postgres. The team reports negligible overhead from the extra hop, and any Postgres-compatible tool can now reach ClickHouse.

  • “Just OLAP it”: How Ramp rebuilt its analytics platform on ClickHouse Cloud

    ClickHouse mediumAdept

    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. The pipeline streams Postgres CDC via Debezium into per-table Kafka topics. Stateless Python enrichers denormalize the records, and a connector loads them into ReplacingMergeTree tables, with recurring OPTIMIZE and FINAL queries handling deduplication. A local benchmark of 60M transactions partitioned by business ID ran 16,000 randomized queries in 12 seconds, and a four-engineer pod shipped to production in about two months. The platform now backs in-app Reporting and Budgets, and Ramp plans to add enriched tables for every core data type.

  • What's New in pg_clickhouse - JSONB Support, SQL value functions, Streaming, and more

    ClickHouse mediumAdept

    pg_clickhouse, the Postgres foreign data wrapper for querying ClickHouse, now pushes down far more operations to ClickHouse. JSONB accessors (->, ->>, jsonb_extract_path) are translated to ClickHouse sub-column syntax. CURRENT_DATE, CURRENT_TIMESTAMP and clock_timestamp() are translated to ClickHouse now()/now64()/nowInBlock64 calls that use the Postgres session time zone and timestamp precision. Array functions now map to their ClickHouse equivalents. Streaming of HTTP driver results in roughly 50MB batches kept container memory under about 100MiB during a full NYC taxi table scan, versus about 600MiB without it.

The quest for software engineering knowledge.

Look:
Layout: