---
title: "What Replo learned optimizing 100+ billion events in ClickHouse"
description: "Replo's in-product analytics for Shopify merchants ingests 3,000-5,000 events per second into ClickHouse and analyzes 100+ billion events, but reaching that point took several data-model resets."
url: "https://swe.quest/articles/what-replo-learned-optimizing-100-billion-events-in-clickhouse-4b7228146ec28a74"
canonical: "https://clickhouse.com/blog/replo"
source: "ClickHouse"
published: "2026-03-09"
difficulty: "medium"
kind: "Case study"
reading_minutes: 7
tags: ["analytics","databases","performance","scalability"]
---

# What Replo learned optimizing 100+ billion events in ClickHouse

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2026-03-09, 7 min read, Case study. Original: [https://clickhouse.com/blog/replo](https://clickhouse.com/blog/replo)

## Summary

Replo's in-product analytics for Shopify merchants ingests 3,000-5,000 events per second into ClickHouse and analyzes 100+ billion events, but reaching that point took several data-model resets. A precomputation pipeline that marked sessions with SummingMergeTree and recomputed them via a refreshable materialized view worked until fractional attribution exposed that MergeTree deduplication is only eventual. Adding FINAL/DISTINCT fixed correctness but made recomputation slower than the one-minute refresh window, causing a runaway backlog. The fix was to recompute only from a small table holding the last 40 minutes of purchase-related events, using joins in a single materialized view, and to handle historical backfills with offline scripts. Follow-up tuning included LowCardinality columns, materialized JSON fields and dropping Nullable types.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Scaling](https://swe.quest/tags/scalability.md) (Distributed systems)

## Prerequisites

- ClickHouse MergeTree engines ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- materialized views
- OLAP query basics ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))

## Keywords

ClickHouse, SummingMergeTree, refreshable materialized views, Replo, Shopify, LowCardinality

## Related posts

- [Building a product analytics solution with ClickHouse](https://swe.quest/articles/building-a-product-analytics-solution-with-clickhouse-786424348993d92f.md): ClickHouse · 2024-12-05 · Medium · 24 min read · Analytics & OLAP, SQL, Databases, Product engineering
  ClickHouse's in-house product analytics platform, Galaxy, stores over 20 billion events (14 TB, roughly 14x compression) in a single denormalized MergeTree table keyed on created\_at.
- [“A generational leap”: How Trio unified payment analytics and cut storage by 88% with ClickHouse Cloud](https://swe.quest/articles/a-generational-leap-how-trio-unified-payment-analytics-and-cut-storage-by-88-b4c6dd92d9387fc0.md): ClickHouse · 2026-04-17 · Medium · 7 min read · Analytics & OLAP, Payments & fintech, Stream processing, Data pipelines
  Trio, a Brazilian payments fintech processing 243M+ payments in H1 2025 and over 1B events a day, consolidated legacy and active systems into ClickHouse Cloud as a single analytical source of truth for reconciliation, compliance and dashboards.
- [Front-end observability at scale: How OpenReplay captures billions of daily events in real time with ClickHouse](https://swe.quest/articles/front-end-observability-at-scale-how-openreplay-captures-billions-of-daily-b210d948927bb0e9.md): ClickHouse · 2026-10-21 · Easy · 8 min read · Analytics & OLAP, Observability, Data pipelines, PostgreSQL, Scaling
  OpenReplay, a self-hosted session replay and product analytics platform, moved behavioral event storage from Postgres to ClickHouse.
- [How Mercado Libre rebuilt its observability platform on ClickHouse Cloud with 75x faster trace queries](https://swe.quest/articles/how-mercado-libre-rebuilt-its-observability-platform-on-clickhouse-cloud-with-a3245c05609a41cc.md): ClickHouse · 2026-08-04 · Medium · 8 min read · Observability, Analytics & OLAP, Scaling, Performance engineering
  Mercado Libre moved the storage layer of its OpenTelemetry-based tracing platform, O11y events, to ClickHouse Cloud.
- [How HighLevel rebuilt its data platform for speed, scale, and simplicity on ClickHouse Cloud](https://swe.quest/articles/how-highlevel-rebuilt-its-data-platform-for-speed-scale-and-simplicity-on-826417013669e8fd.md): ClickHouse · 2026-01-12 · Medium · 8 min read · Analytics & OLAP, Databases, Scaling, Observability
  HighLevel replaced MySQL, Elasticsearch, Firestore and a document database with ClickHouse Cloud for lead activity, workflow logs, notifications and billing dashboards.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
