---
title: "Front-end observability at scale: How OpenReplay captures billions of daily events in real time with ClickHouse"
description: "OpenReplay is a self-hosted session replay and product analytics platform that helps developers reproduce bugs by showing them exactly what a user did. The team replaced Postgres with ClickHouse to handle billions of behavioral events per day, using a single TTL setting to end weekend-long manual retention cleanups and dropping session search times from up to 10 seconds to about one second. Materialized views in ClickHouse reduced the time to modify data pipeline transformations from two days to half a day by centralizing logic that once required separate Go workers. The largest customers run a single vertically scaled ClickHouse instance ingesting up to 6 TB daily, with sub-second queries enabled by a query cache. The database schema consists of two main tables, and native JSON support allows custom events to be inserted and queried as columns for funnels, heat maps, and flow charts."
---

# Front-end observability at scale: How OpenReplay captures billions of daily events in real time with ClickHouse

[Clickhouse](https://yomu.fyi/company/clickhouse) · Oct 21, 2026

**Type:** Problem & solution

## Summary

OpenReplay is a self-hosted session replay and product analytics platform that helps developers reproduce bugs by showing them exactly what a user did. The team replaced Postgres with ClickHouse to handle billions of behavioral events per day, using a single TTL setting to end weekend-long manual retention cleanups and dropping session search times from up to 10 seconds to about one second. Materialized views in ClickHouse reduced the time to modify data pipeline transformations from two days to half a day by centralizing logic that once required separate Go workers. The largest customers run a single vertically scaled ClickHouse instance ingesting up to 6 TB daily, with sub-second queries enabled by a query cache. The database schema consists of two main tables, and native JSON support allows custom events to be inserted and queried as columns for funnels, heat maps, and flow charts.

## Context

OpenReplay is a self-hosted session replay and product analytics platform that needed to handle billions of behavioral events and terabytes of data per day within each customer’s own environment. Initially built on Postgres, they faced performance bottlenecks and operational complexity with retention cleanup. They migrated to ClickHouse to achieve real-time ingestion, sub-second queries, and simplified maintenance.

## Approach / What changed

OpenReplay replaced its Postgres-based event storage with a single vertically scaled ClickHouse instance for all behavioral events. They configured a TTL setting to automate data retention, implemented a chain of materialized views for data transformation, and leveraged ClickHouse’s native JSON support for custom events. They also enabled the query cache for faster repeat queries.

## Takeaways

- ClickHouse’s TTL feature eliminated manual weekend-long retention cleanups that required locking tables and coordinating with customers, reducing operational overhead significantly.
- Materialized views in ClickHouse reduced the time to change data pipeline transformations from two days to half a day by centralizing logic that previously required separate Go workers.
- OpenReplay runs a single vertically scaled ClickHouse instance for its largest customers, ingesting up to 6 TB per day with sub-second queries, made faster by enabling the query cache.

## FAQ

### Why did OpenReplay replace Postgres with ClickHouse?

Postgres could not handle behavioral analytics queries quickly; session search took up to 10 seconds after tuning, and retention cleanup required locking tables and weekend coordination. ClickHouse reduced query times to about one second and automated retention via TTL.

### How does OpenReplay handle custom user-defined events?

ClickHouse's native JSON support allows custom events to be inserted into the same table and queried as columns, enabling features like funnels and heat maps without requiring schema modifications.

### What scale does OpenReplay achieve with ClickHouse?

The largest customers ingest billions of events and up to 6 TB per day on a single vertically scaled ClickHouse instance, with sub-second query responses aided by a query cache.

**Tags:** [ClickHouse](https://yomu.fyi/topic/clickhouse), [Data Pipelines](https://yomu.fyi/topic/data-pipelines), [Observability](https://yomu.fyi/topic/observability), [Postgres](https://yomu.fyi/topic/postgres), [Real-time](https://yomu.fyi/topic/real-time)

- Source: [Clickhouse](https://clickhouse.com/blog/openreplay-front-end-observability-at-scale-clickhouse)
- Source URL: https://clickhouse.com/blog/openreplay-front-end-observability-at-scale-clickhouse
- Ingested by Yomu: 2026-10-21T21:00:11.703Z

[Read original post](https://clickhouse.com/blog/openreplay-front-end-observability-at-scale-clickhouse)
