Back to Systems
Next.jsGoKafkaClickHouseWebSockets

E-commerce Analytics Dashboard

Real-time Event Streaming

Real-time pipeline aggregating millions of events to provide instant insights into conversion metrics and operational bottlenecks.

50k+Events/Sec
< 50msQuery Latency
5TB+Data Volume

The Problem

Traditional analytics dashboards were 24 hours behind. The business needed real-time insights into cart abandonment and inventory velocity during flash sales.

Architecture

Designed a high-throughput ingest pipeline using Go microservices publishing to Apache Kafka. ClickHouse consumes from Kafka using Materialized Views for real-time aggregation.

Decision Log

"Chose ClickHouse over PostgreSQL/Elasticsearch for its unparalleled OLAP performance on time-series event data. Go was selected for the ingest layer due to its efficient concurrency model."

Performance

Optimization

Implemented a WebSocket layer in Node.js to push live dashboard updates to the Next.js frontend, avoiding expensive long-polling.

Scaling Logic

Kafka partitions allow linear scaling of the Go ingest consumers. ClickHouse cluster scales horizontally for read queries.

Challenges

Exactly-once processing semantics. Solved by implementing deduplication logic in the ClickHouse Materialized Views using ReplacingMergeTree engines.

Final Impact

Provided the operations team with a live dashboard during Black Friday, allowing them to dynamically adjust pricing and inventory in real-time, boosting revenue by 15%.