Engineering story
We moved event analytics to ClickHouse. Funnels and breakdowns that couldn't finish before now come back in about a second. Here's the honest version of how.
Mostly Good Metrics started on PostgreSQL, and Postgres carried us a long way. Date-partitioned event tables, nightly aggregates, and HyperLogLog sketches kept dashboards quick for most projects.
Then our largest customer — a project sending 50M+ events — started asking harder questions. Simple charts stayed fast, but the heavy ones didn't: multi-step funnels over months of data, breakdowns across high-cardinality properties, retention cohorts over long ranges. Some of those queries didn't come back slow. They didn't come back at all.
You can only pre-aggregate the questions you predicted. The whole point of analytics is asking the ones you didn't.
We moved analytical reads to ClickHouse, a columnar database built for exactly this workload. Real numbers, not benchmarks on synthetic data:
10–100×
The queries that strained Postgres — long ranges, big projects, high-cardinality breakdowns — got faster by one to two orders of magnitude.
~1s
Funnels and breakdowns that previously couldn't complete at 50M+ events now finish in about a second.
Exact
Scanning raw events is now cheap enough that approximate unique counts became exact ones. The number on your dashboard is the number.
52M
We backfilled 52 million historical events into ClickHouse and verified counts against Postgres before serving a single query from it.
Each database does the job it's good at. No exotic infrastructure, no data pipeline to babysit.
Users, projects, API keys, saved funnels, billing — everything transactional stays in PostgreSQL, where relational integrity matters.
Raw events land in a columnar store built for scanning billions of rows. Funnels, retention, breakdowns, and the event explorer query it directly.
A nightly job compares event counts between the two stores, per project, per day. If they ever disagree, we know before you do.
Fast queries don't matter if the data behind them is shaky. The boring parts got as much attention as the fast parts:
None of this required a data team, a Kafka cluster, or a six-month replatform. It's the same simple analytics — it just stopped having a ceiling.
Drop in an SDK, track events, and ask heavy questions without worrying about the database behind them.