SaaS Analytics Platform
In ProgressSaaS / Product Analytics

SaaS Analytics Platform

Enterprise-grade product analytics at 1/10th the cost — processing 50M+ events daily

A multi-tenant product analytics platform built as an affordable alternative to Amplitude and Mixpanel for mid-market SaaS companies. The platform ingests 50M+ events daily from 500+ business tenants, provides sub-second query responses via ClickHouse, and offers a drag-and-drop dashboard builder with funnel analysis, cohort tracking, and automated reporting. Currently in active development with the event pipeline and core analytics engine complete, and the dashboard builder in its final phase.

Role: Lead Backend Architect & Technical Co-Founder
Client: Insightful (Internal Startup)
Team: 4-person team (1 backend architect, 1 frontend dev, 1 DevOps engineer, 1 product designer)
Started: September 2025
50M+
Events/Day
Sustained throughput with 99.95% delivery guarantee via Kafka
<200ms
Query Time (p95)
Complex analytical queries across billions of events return in <200ms
500+
Tenants
Complete data isolation with tenant-level ClickHouse partitioning
99.97%
Uptime
Kubernetes with multi-AZ deployment and automated failover

The Challenge

Mid-market SaaS companies (1K-50K users) were stuck between expensive enterprise analytics tools (Amplitude at $50K+/year, Mixpanel at $25K+/year) and open-source alternatives that couldn't handle scale or provide real-time insights. PostHog was the closest competitor but required significant self-hosting expertise and still struggled with query performance above 10M events/day. Product teams at these companies were making decisions based on gut feeling or spreadsheet exports because their analytics tools were either too expensive, too slow, or too complex. Our market research across 40 SaaS founders showed that 85% would pay $500-2,000/month for a tool that gave them Amplitude-level insights with Stripe-level simplicity. The technical challenge was building a system that could ingest billions of events monthly, return complex analytical queries in under 200ms, and serve 500+ tenants with complete data isolation — all at a price point that undercuts Amplitude by 90%.

The Approach

The architecture is split into four distinct services: ingestion, storage, query, and presentation. The ingestion service is a NestJS application behind an API gateway that accepts events from our JavaScript, React, and Node.js SDKs via a batched HTTP endpoint. Events are validated, enriched with geolocation and device data, and published to Kafka topics partitioned by tenant ID. The storage service consists of Kafka consumers that write events to ClickHouse in optimized batch inserts (100K rows/batch). ClickHouse is configured with tenant-based partitioning and automatic materialized views that pre-aggregate common query patterns (daily active users, event counts by type, funnel step completions). The query service translates the dashboard builder's visual query language into optimized ClickHouse SQL, with a Redis caching layer for repeated queries and a query planner that routes simple queries to materialized views instead of scanning raw events. The presentation layer is a React application with a drag-and-drop dashboard builder powered by @dnd-kit, supporting line charts, bar charts, funnels, cohort tables, and retention curves. Everything runs on Kubernetes with horizontal pod autoscaling based on CPU, memory, and custom Kafka lag metrics.

Key Features

Event tracking SDKs for JavaScript, React, and Node.js with <1KB bundle size
Drag-and-drop dashboard builder with 8 visualization types
Funnel analysis with conversion rates, drop-off identification, and user-level drill-down
Cohort analysis with behavioral and time-based grouping
Retention curves (day-0 through day-90) with segment comparison
Real-time event streaming dashboard with live event feed
Automated weekly and monthly reports with PDF export and Slack integration
Custom metric definitions with formula builder (e.g., WAU/MAU ratio)
Team permissions with viewer, editor, and admin roles per workspace
GDPR-compliant data handling with user deletion API and data retention policies
Scope:18 pages, event ingestion pipeline (3 SDKs), ClickHouse query engine, Kafka event bus, drag-and-drop dashboard builder, automated reporting service, tenant management admin panel, Kubernetes infrastructure

Built With

ReactTypeScriptNestJSClickHouseApache KafkaKubernetesRedisDocker

Challenges & Solutions

Challenge

ClickHouse query performance degraded exponentially with complex multi-tenant JOIN operations at scale — a cohort analysis query across 30 days of data for a tenant with 5M events was taking 8+ seconds, far above the 200ms target

Solution

Implemented a three-pronged optimization strategy: (1) materialized views that pre-aggregate common patterns (DAU, event counts, funnel steps) and are updated incrementally on each batch insert, (2) tenant-level data partitioning so queries only scan relevant partitions, and (3) a query planner that detects when a query can be answered from materialized views instead of raw events. This brought the same cohort query down to 120ms

Challenge

Kafka consumer lag during peak hours (10AM-2PM EST when most SaaS products see highest usage) caused analytics to be delayed by 5-15 minutes, making the "real-time" dashboard feel stale

Solution

Designed a priority-based consumer group strategy with three tiers: P0 consumers handle dashboard-visible metrics (event counts, active users) with aggressive parallelism, P1 consumers process funnel and cohort pre-aggregations, and P2 consumers handle raw event archival. Kubernetes HPA auto-scales consumer pods based on custom Kafka lag metrics — when P0 lag exceeds 30 seconds, new consumers spin up within 45 seconds

Challenge

The JavaScript SDK needed to be under 1KB gzipped to avoid impacting client app performance, but still needed to support automatic page view tracking, session management, identity resolution, and batched event delivery

Solution

Built a minimal core SDK (680 bytes gzipped) that handles event queuing and batched delivery. Advanced features (auto-tracking, session management, identity linking) are loaded as optional plugins via dynamic import — the client only pays the bundle cost for features they use. The SDK batches events and flushes every 5 seconds or 20 events (whichever comes first), with beacon API fallback for page unload events

Gallery

Drag-and-drop dashboard builder with funnel analysis
Real-time event streaming dashboard with live feed
Cohort analysis and retention curves visualization

Project Timeline

Event Ingestion Pipeline

Built NestJS ingestion service with JavaScript/React/Node SDKs, Kafka event bus, and ClickHouse batch writers. Validated at 50M+ events/day throughput.

Due: Oct 20, 2025Completed: Oct 17, 2025

Query Engine & Materialized Views

Developed query planner that translates visual queries to optimized ClickHouse SQL. Created materialized views for DAU, funnels, and cohorts. Hit <200ms p95 target.

Due: Dec 1, 2025Completed: Nov 28, 2025

Dashboard Builder & Visualizations

Building drag-and-drop dashboard builder with 8 chart types, funnel analysis, cohort tables, and retention curves. Adding template dashboards for common use cases.

Due: Feb 15, 2026

Reporting, Permissions & Launch

Automated weekly/monthly reports with PDF and Slack delivery. Team permissions with role-based access. GDPR compliance features. Public beta launch.

Due: Apr 1, 2026
TypeScriptTestedCI/CDDockerHigh PerformanceSecure

Related Projects

FinPay — Fintech Payment Gateway
Completed

FinPay — Fintech Payment Gateway

A PCI DSS Level 1 compliant payment processing platform built for PayStream, a fintech startup serving small and mid-size e-commerce merchants. The platform handles multi-currency payment processing across 15 currencies, real-time transaction monitoring with custom fraud scoring, automated daily reconciliation, and a merchant self-service onboarding portal. Currently processing $2M+ monthly transaction volume with a 99.99% success rate and 98.5% fraud detection accuracy.

$2M+ monthly volume with 99.99% success rate and real-time fraud detection

ReactTypeScriptNestJSPostgreSQL+4
DevCollab — Real-Time Code Review Platform
Completed

DevCollab — Real-Time Code Review Platform

A real-time code review and pair programming platform built for distributed engineering teams. DevCollab combines Google Docs-style collaborative editing with GitHub PR workflows, live cursors, inline threaded comments, peer-to-peer video chat via WebRTC, and session recording for async review. The platform reduced code review turnaround from an average of 48 hours to under 2 hours for CodeBridge's 40+ person engineering team, and now serves 120+ active teams with 8,000+ review sessions monthly.

Code review turnaround from 48 hours to under 2 hours — for teams that ship fast

Next.jsTypeScriptSocket.IOWebRTC+4
HealthTrack Dashboard
Completed

HealthTrack Dashboard

A real-time health monitoring dashboard for VitalSync, a fitness technology startup. The platform aggregates data from 12+ wearable device brands (Fitbit, Apple Watch, Garmin, Whoop, Oura, Samsung Galaxy Watch, and more) into a unified dashboard with interactive D3.js visualizations, personalized health insights powered by a lightweight ML model, and automated weekly health reports. Currently serving 8,000+ users with 2M+ daily data points.

Unified health insights from 12+ wearable brands — real-time, personalized, actionable

Next.jsD3.jsNestJSPostgreSQL+4