Replo, an AI-powered page builder for 4,000+ Shopify merchants, shares the real story of building real-time analytics on ClickHouse at scale — including the mistakes. Starting with a single flat table, the team iterated through precomputed results using SummingMergeTree and refreshable materialized views, then hit a critical issue when eventual deduplication caused runaway recomputation loops. The final fix was scoping recomputation to only the last 40 minutes of purchase events, dramatically reducing data volume and eliminating cascading failures. Additional optimizations include LowCardinality columns, materializing JSON fields, and avoiding Nullable types. The system now handles 3,000–5,000 events/second and 100+ billion total events with sub-minute dashboard latency.
Table of contents
Real-time analytics for live campaigns #From one table to precomputation #Real-time meets eventual consistency #The last approach: keeping it small #A scalable foundation for what's next #Sort: