Polymarket, a prediction market platform, outgrew PostgreSQL for analytical workloads as data volumes grew. Queries for internal dashboards timed out and the leaderboard feature consumed excessive Postgres resources. They migrated analytical workloads to ClickHouse, building a data warehouse that ingests on-chain trading data via Goldsky, web analytics from S3 via ClickPipes, and off-chain metadata synced from Postgres. The leaderboard was rebuilt using ClickHouse materialized views, reducing computation time from timeouts to milliseconds. The resulting API handles hundreds of requests per second at ~25ms average latency, freed Postgres for transactional workloads, and enabled more granular categorical leaderboards.

7m read timeFrom clickhouse.com
Post cover image
Table of contents
Postgres isn’t built to do everything #Designing the solution #Building the data warehouse #From internal analytics to user facing features #Impact and benefits #What's next #

Sort: