Skip to content

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

ClickHouse 6 min read Case study mediumAdept

How Polymarket scaled their data stack with Postgres and ClickHouse

Polymarket moved analytical workloads off its production PostgreSQL cluster and onto ClickHouse after internal Hex dashboards started timing out and scheduled leaderboard aggregations competed with transactional trading traffic. The new warehouse combines three sources: on-chain trades streamed in through Goldsky's ClickHouse sink, S3 clickstream files ingested with ClickPipes, and off-chain metadata pulled on a schedule from Postgres via the PostgreSQL table engine into MergeTree tables. Leaderboards are now built with refreshable materialized views and served by a Go API through parameterized views, which enabled per-category and per-time-period leaderboards. The leaderboard migration took about two weeks and serves hundreds of requests per second at roughly 25 ms average latency.

Assumes: OLTP vs OLAP workloadsmaterialized views

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.

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

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

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

    ClickHouse mediumAdept

    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.

  • How Ridgeline unified Iceberg and ClickHouse into one analytics layer for investment management

    ClickHouse easyNovice

    Ridgeline, an all-in-one investment management platform, moved performance analytics off a shared Postgres cluster onto ClickHouse Cloud. Postgres could not handle inception-to-date reports over decades of daily, 40-80-column P&L data across thousands of portfolios for customers 10-40x larger than before. The architecture writes accounting data directly to ClickHouse, replicates vendor data from Postgres via ClickPipes CDC, and lands multi-billion-row historical uploads in Iceberg via Spark, reading older data through ClickHouse's Iceberg connector. Materialized views over ReplacingMergeTree serve read-optimized data, so report batches finish in minutes instead of hours and the company has more than doubled its live customers.

The quest for software engineering knowledge.

Look:
Layout: