Prompt
I'm building a backend that needs high-volume trace storage and search
Latest observation
For high-volume trace storage and search, you’ll usually want a system optimized for:
- very high write throughput
- indexed search by trace/span attributes
- efficient time-based retention
- fast filtering and aggregation
- low operational overhead
Good architecture options
1) OpenTelemetry + ClickHouse
A very common choice for trace analytics at scale.
Why it works well
- Excellent compression for event-like data
- Fast analytical queries over large datasets
- Good for filtering by service, operation, status, duration, tags
- Works well with large retention windows
Tradeoffs
- You need to design schemas and partitioning carefully
- Not ideal for highly transactional workloads
- Query latency is good, but it’s still an OLAP system, not a pure search engine
Best for
- High-volume distributed tracing
- Long retention
- Ad hoc analysis and dashboards
2) OpenSearch / Elasticsearch
Best if your search needs are very textual or highly flexible.
Why it works well
- Powerful full-text search
- Flexible filtering and faceting
- Familiar query model for many teams
Tradeoffs
- Can get expensive at large scale
- High storage overhead
- Heavy indexing costs
- Operational tuning can be tricky
Best for
- Rich search over trace metadata
- Investigator-style exploration
- Moderate-to-high volume, but cost can be a concern
3) Tempo + object storage + indexing layer
If you want a trace-native system, Grafana Tempo is worth considering.
Why it works well
- Designed for tracing
- Cheap storage using object stores like S3/GCS
- Scales well for ingestion
Tradeoffs
- Search is more limited than Elasticsearch/ClickHouse depending on setup
- Usually paired with metrics/logs for full observability workflows
Best for
- Very large trace retention
- Cost-sensitive environments
- Grafana-based observability stacks
4) Cassandra / ScyllaDB + search index
Useful if your primary need is extremely high ingest and predictable key-based retrieval.
Why it works well
- High write throughput
- Low-latency reads by key
- Scales horizontally
Tradeoffs
- Search is not natural unless you build secondary indexing/search on top
- More engineering effort
- Not ideal for rich analytics queries
Best for
- Trace retrieval by trace ID
- Custom-built pipelines
- Systems where write scale is the top priority
Recommended approach for most teams
If you need high-volume trace storage and search, the most practical default is:
- OpenTelemetry Collector for ingestion
- ClickHouse for indexed storage and analytics
- optionally object storage for raw archive/backups
This gives you a good balance of:
- scale
- searchability
- cost
- operational simplicity
Key design considerations
Data model
Store:
- trace_id
- span_id
- parent_span_id
- service name
- operation name
- timestamp / duration
- status / error flag
- tags/attributes
- resource metadata
Indexing strategy
Index only what you query frequently:
- trace_id
- service.name
- span.name
- status
- duration buckets
- timestamp
- selected attributes
Avoid indexing every tag if cardinality is high.
Partitioning
Partition by:
- time window
- service or tenant if multitenant
This keeps queries fast and retention manageable.
Retention
Common pattern:
- hot storage for recent traces
- downsampled or archived data for older traces
- TTL-based expiry
Cardinality control
Trace data can explode in cardinality:
- user IDs
- request IDs
- dynamic URLs
- free-form tags
Be careful about indexing these directly.
If you want a concrete recommendation
- Need search + analytics + scale: ClickHouse
- Need full-text search first: OpenSearch
- Need cheapest large-scale trace retention: Tempo + object storage
- Need custom write-heavy key retrieval: ScyllaDB/Cassandra
If you want, I can also help you with:
- a reference architecture
- a database schema for traces/spans
- a query/indexing strategy
- a comparison of ClickHouse vs OpenSearch vs Tempo for your exact use case