London Meetup Report: Scaling Analytics with PostHog and Introducing HouseWatch
PostHog scaled its product analytics platform by moving from Postgres to ClickHouse, with an events table holding roughly 62 TB uncompressed for a single column. Two optimizations drove most of the gains: materializing frequently queried JSON properties into columns, and a person overrides table that records merged user IDs with versions, is joined at query time, and is periodically rolled back into the events. Together these cut Y Combinator's average query time from 18s to 1s and P95 from 60s to 4s, and a user-facing sampling control lets users trade accuracy for speed. PostHog also introduced HouseWatch, an open-source React app deployed via Docker for monitoring long-running ClickHouse queries, analyzing table and column disk usage, killing queries, and managing migrations.
Related posts
- How GitLab serves sub-second analytics to 50 million users
ClickHouse easyNovice
GitLab moved its user-facing product analytics from Postgres to ClickHouse after dashboards repeatedly hit its 15-second performance ceiling. Hierarchical multi-join queries over 100M+ rows dropped from 30–40 seconds to 0.24 seconds, and ClickHouse is now the default OLAP engine across GitLab.com, Dedicated and self-managed deployments. A hybrid data access layer routes queries between Postgres and ClickHouse, ingestion runs as TSV over HTTP plus an in-house CDC framework (Siphon), and materialized views are the main optimization tool. The team built and ran its own ClickHouse operator on object storage before moving SaaS to ClickHouse Cloud, and warns against self-managing unless required. It also flags poor visibility into background mutations as an ongoing operational pain.
- How Kami scaled from 80M to nearly 2B events per week with ClickHouse
ClickHouse mediumAdept
Kami's Postgres event tracking (Rails writing JSONB rows, queried via Redash) collapsed when COVID pushed weekly events from about 80M to nearly 2B. Read replicas, a message queue and NVMe storage only delayed the problem, and Citus and CDC tools like Debezium could not keep up. The team moved to ClickHouse using a custom Java Kafka consumer that turned JSON into structured columns, plus a manual backfill of historical events. They later added MaterializedPostgreSQL and Kafka syncs for production and CockroachDB CRM data, and built dbt daily per-user rollups that cut DAU queries from 3-4 minutes over 140B rows to about 1 second over 1.3B rows.
- “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.
- Front-end observability at scale: How OpenReplay captures billions of daily events in real time with ClickHouse
ClickHouse easyNovice
OpenReplay, a self-hosted session replay and product analytics platform, moved behavioral event storage from Postgres to ClickHouse. Session search dropped from roughly 3–10 seconds to about one second, and ~1 TB event tables compressed to 1–2 GB. ClickHouse's TTL replaced weekend-long delete-and-vacuum retention jobs. A chain of materialized views off a single flat events table cut pipeline changes from two days to half a day, and native JSON makes custom event properties queryable as columns. Each customer deployment runs on a single vertically scaled ClickHouse instance, ingesting up to billions of events and ~6 TB per day, because avoiding sharding keeps self-hosted operations lean.
- Data Hive: The story of beehiiv’s journey from Postgres to ClickHouse
ClickHouse easyNovice
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. The design leans on ReplacingMergeTree for idempotent ingestion and event replay, dictionaries to enrich inserts without joins, ephemeral columns for intermediate calculations, materialized views as pre-aggregated shadow tables with alternate sort keys, and window functions for analytics. After six months the system held over 33 billion raw events in 1.5 TiB compressed (13 TiB uncompressed), with 22 ms median and 85 ms average query times. Creators now see send performance within seconds instead of hours.