Powered by ClickHouse
Sub-second analytics on billions of events. Built for scale, speed, and real-time insights.
Architecture Overview
Session recording
Validation
Async writes
Real-time queries
Why ClickHouse
Claymore is ClickHouse Native. Our architecture is designed specifically for ClickHouse's columnar storage model, not as an abstraction over multiple databases.
Columnar Storage
Session replay data is stored in columnar format, enabling efficient compression and lightning-fast analytical queries across billions of events.
Compression Codecs
ZSTD and LZ4 codecs achieve 10:1 compression ratios on replay data, reducing storage costs by 90% compared to row-based databases.
Materialized Views
Real-time aggregations are computed on insert using Materialized Views, enabling instant dashboards without batch processing jobs.
TTL Policies
Automatic data retention with TTL policies enables tiered storage, moving older data to S3 while keeping recent data instantly queryable.
AI + ClickHouse Integration
Our AI Analyst isn't just a ChatGPT wrapper. It's a sophisticated system that generates and executes SQL queries against ClickHouse in real-time.
Natural Language Input
"Show sessions where users from Berlin got error 500 during checkout with cart value over $100"Text-to-SQL Generation
SELECT
s.sessionId,
s.userId,
e.errorMessage,
toDecimal64(s.cartValue, 2) AS cartValue,
formatDateTime(s.createdAt, '%Y-%m-%d %H:%M:%S') AS timestamp
FROM sessions s
INNER JOIN (
SELECT * FROM events FINAL
WHERE errorCode = 500
) e ON s.sessionId = e.sessionId
PREWHERE s.projectId = {projectId:String}
AND s.createdAt >= toStartOfDay(now() - INTERVAL 7 DAY)
WHERE s.country = 'DE'
AND s.city ilike 'berlin'
AND e.page ilike '%checkout%'
AND s.cartValue > 100
ORDER BY s.createdAt DESC
LIMIT 50ClickHouse Execution
Performance Benchmarks
| Metric | Legacy Tools | Claymore (ClickHouse) |
|---|---|---|
| Time to Insight | Minutes (pre-aggregated) | Seconds (raw data) |
| Data Retention | 30-90 days | Unlimited (tiered S3) |
| Cardinality Limit | High costs for custom tags | Unlimited (sparse indexing) |
| Query Latency (p50) | N/A (pre-computed) | <50ms |
| Query Latency (p99) | N/A (pre-computed) | <200ms |
| Compression Ratio | 2-3x typical | 10:1 (ZSTD) |
| SDK Size | 50-200KB | <20KB gzipped |
High Cardinality Handling
User-defined tags can explode index size in OLAP systems. Here's how we solve it:
LowCardinalityKnown dimensions (country, browser, OS) use LowCardinality type for dictionary-encoded storage.
Mapping TablesCustom user tags stored in separate mapping tables to prevent index bloat on main event tables.
CODEC(ZSTD)Aggressive compression on all string columns reduces storage footprint without sacrificing query speed.
Primary Key DesignCarefully ordered primary keys (timestamp, projectId, sessionId) maximize data locality and query pruning.
OpenTelemetry Compatibility
Native OTel support for distributed traces (roadmap)
Export session logs in OTel format
Connect product analytics with infrastructure observability
ClickHouse Native Architecture
We don't abstract away the database. Claymore is built specifically for ClickHouse's strengths: columnar storage, real-time aggregations, and massive scale.
Read: Why We Chose ClickHouse →