Switching From PostgreSQL to ClickHouse for Improved Performance and Scalability
InfoQ, Tuesday, July 7th, 2026
Momentic migrated caching from PostgreSQL to ClickHouse, scaling to 20 billion entries at ~250ms latency.
InfoQ reports on how AI testing platform Momentic migrated its caching infrastructure from PostgreSQL to ClickHouse to handle explosive growth from 80,000 to over a billion cache entries, which had caused lock contention and elevated resource usage.
ClickHouse's column-oriented storage and sparse primary indexes outperformed PostgreSQL's B-tree approach; a primary key combining test ID, step ID, version, and timestamp let 90% of queries touch just one or two data segments.
Using ReplacingMergeTree consolidated multiple queries and deduplicated data, eliminating a Redis layer. Migration ran safely via parallel writes, and the platform now handles 20 billion entries and 2 million daily queries at roughly 250ms average latency.