Real-Time Analytics: sub-200ms p95 on Kafka and ClickHouse by Krishna BhupathiReal-Time Analytics: sub-200ms p95 on Kafka and ClickHouse by Krishna Bhupathi

Real-Time Analytics: sub-200ms p95 on Kafka and ClickHouse

Krishna Bhupathi

Krishna Bhupathi

Client project for a SaaS company. The client's name is withheld under NDA. My role: full-stack engineer, from pipeline to UI.

The problem

The product needed analytics its customers could explore themselves, on fresh data. Running reporting queries against the transactional database was slow and put the main app at risk.

What I built

Ingestion from web and mobile SDKs and a server API, streamed through Kafka.
Processing in Node.js: enrichment, deduplication with Redis, and aggregation.
Storage split by workload: ClickHouse for fast analytical queries, PostgreSQL for transactional data.
A custom query engine tuned for low-latency reporting.
A self-serve dashboard in Next.js with server rendering and streaming, so customers build their own reports.

Results

Query p95 under 200ms
One engineer across the whole stack, from event ingestion to the dashboard UI
Stack: Next.js, Node.js, Kafka, ClickHouse, PostgreSQL, Redis, AWS. Code is private under NDA; architecture walkthrough on request.
Like this project

Posted Oct 10, 2026

Self-serve analytics for a SaaS product: Kafka ingestion, ClickHouse storage, a custom query engine and a Next.js dashboard, with query p95 under 200ms.