ClickhouseProblem & solution
How Infinitas Learning uses ClickHouse Managed Postgres to process billions of events for 1.6M unique learners
Summary
Infinitas Learning, a major European educational publisher, processes results for 1.6 million learners and 324 million assignments annually. After moving from Neon to ClickHouse Managed Postgres, transactional P50 latency dropped from milliseconds to double-digit microseconds, with P99 in double-digit milliseconds. Customer-facing analytics migrated from a complex pipeline to ClickHouse Cloud, where optimization and a distributed cache cut P99 latency from about 13 seconds to 410 milliseconds. The migration of 750 GB of data completed in 16 hours with zero downtime. The team now uses Postgres for transactions and ClickHouse for analytics, with plans to unify them via the pg_clickhouse extension.
Context
Infinitas Learning initially built an event-sourced system using Kafka, Avro, and Flink, which was complex and not real-time. Postgres sufficed for transactions but not analytics. They tried Neon but faced challenges with version upgrades, cache coupling, and region deprecation, forcing another migration.
Approach / What changed
The team uses ClickHouse Managed Postgres for transactional workloads with PL/pgSQL functions as the API, hiding underlying tables to prevent runaway queries. ClickPipes synchronizes data to ClickHouse Cloud for real-time analytics, where query optimization and a distributed cache were added after performance issues.
Takeaways
The team replaced a REST API layer with public PL/pgSQL functions, giving platform teams direct database access while hiding underlying tables to prevent ‘doom queries.’
ClickHouse compressed a 300 GB table to 27 GB (11x reduction), enabling fast analytics on nearly 2 billion rows.
Distributed caching improved P99 latency from about 13 seconds to 410 milliseconds for teacher-facing dashboards.
FAQ
Why did Infinitas Learning migrate from Neon to ClickHouse Managed Postgres?
Neon had challenges with major Postgres version upgrades, cache tied to unpredictable compute, and unavailable extensions like pg_clickhouse. Additionally, their Azure region was deprecated, forcing a move.
How did they migrate 750 GB of data with zero downtime?
They set up ClickHouse Managed Postgres, built the schema, and used ClickPipes with logical replication. Data copied in 16 hours; cutover involved switching endpoints within 20 minutes during a maintenance window.
What are their plans for unifying Postgres and ClickHouse?
They plan to use the pg_clickhouse Postgres extension to push query execution down to ClickHouse, so transactions and analytics live behind a single service, reducing two connections to one.
Source and freshness
- Source
- clickhouse.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.