---
title: "How Polymarket scaled their data stack with Postgres and ClickHouse"
description: "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."
url: "https://swe.quest/articles/how-polymarket-scaled-their-data-stack-with-postgres-and-clickhouse-59e5246433cf4cae"
canonical: "https://clickhouse.com/blog/how-polymarket-scales-data-with-postgres-and-clickhouse"
source: "ClickHouse"
published: "2026-01-21"
difficulty: "medium"
kind: "Case study"
reading_minutes: 6
tags: ["analytics","postgres","data-pipelines","scalability"]
---

# How Polymarket scaled their data stack with Postgres and ClickHouse

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2026-01-21, 6 min read, Case study. Original: [https://clickhouse.com/blog/how-polymarket-scales-data-with-postgres-and-clickhouse](https://clickhouse.com/blog/how-polymarket-scales-data-with-postgres-and-clickhouse)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Data pipelines](https://swe.quest/tags/data-pipelines.md) (Data & databases)
- [Scaling](https://swe.quest/tags/scalability.md) (Distributed systems)

## Prerequisites

- OLTP vs OLAP workloads ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- materialized views

## Keywords

ClickHouse, PostgreSQL, Polymarket, Goldsky, ClickPipes, Hex, MergeTree

## Related posts

- [How GitLab serves sub-second analytics to 50 million users](https://swe.quest/articles/how-gitlab-serves-sub-second-analytics-to-50-million-users-cabf627f25c869fd.md): ClickHouse · 2025-10-21 · Easy · 10 min read · Analytics & OLAP, PostgreSQL, Databases, Scaling
  GitLab moved its user-facing product analytics from Postgres to ClickHouse after dashboards repeatedly hit its 15-second performance ceiling.
- [“Just OLAP it”: How Ramp rebuilt its analytics platform on ClickHouse Cloud](https://swe.quest/articles/just-olap-it-how-ramp-rebuilt-its-analytics-platform-on-clickhouse-cloud-36298842faab88cc.md): ClickHouse · 2026-01-20 · Medium · 5 min read · Analytics & OLAP, Event-driven architecture, Data pipelines, PostgreSQL, Queues & messaging
  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.
- [Longbridge Technology simplifies their architecture and achieves 10x performance boost with ClickHouse](https://swe.quest/articles/longbridge-technology-simplifies-their-architecture-and-achieves-10x-e3a982c02b6e4b33.md): ClickHouse · 2025-03-17 · Medium · 8 min read · Analytics & OLAP, Databases, PostgreSQL, Payments & fintech
  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.
- [98% faster queries, 50% lower cloud costs: Verihubs’ journey from Postgres to ClickHouse](https://swe.quest/articles/98-faster-queries-50-lower-cloud-costs-verihubs-journey-from-postgres-to-f6535061aff525b1.md): ClickHouse · 2026-07-06 · Medium · 6 min read · Analytics & OLAP, Data pipelines, PostgreSQL, Event-driven architecture
  Verihubs replaced a Postgres warehouse fed by daily Airflow batch pulls with a ClickHouse-based real-time OLAP stack.
- [How Ridgeline unified Iceberg and ClickHouse into one analytics layer for investment management](https://swe.quest/articles/how-ridgeline-unified-iceberg-and-clickhouse-into-one-analytics-layer-for-b655d34ec29d6b86.md): ClickHouse · 2026-10-14 · Easy · 8 min read · Analytics & OLAP, Data pipelines, PostgreSQL, Scaling
  Ridgeline, an all-in-one investment management platform, moved performance analytics off a shared Postgres cluster onto ClickHouse Cloud.

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)
