How should crypto candlestick data be stored?
Good question — this is a data-engineering design problem with several real trade-offs. Here's the honest landscape:
Candlestick data is append-only (history never changes once a bar closes) but gets queried repeatedly for charting, backtesting, and indicators. So the "correct" storage depends on whether you prioritize write throughput (ingesting live ticks) or read performance (serving charts fast).
1. Columnar/OLAP (Parquet + object storage, or ClickHouse/DuckDB) The best default for analytics workloads. Candle data compresses extremely well column-wise (OHLCV repeats patterns), and columnar engines let you scan millions of bars in milliseconds. For backtesting and research, Parquet files partitioned by symbol+date are cheap and standard.
2. Time-series databases (TimescaleDB, InfluxDB) Optimized for exactly this shape — time as the primary index, continuous aggregates for pre-rolled higher timeframes. TimescaleDB (Postgres extension) is a popular middle ground because you keep SQL.
3. Plain relational (Postgres/MySQL)
Fine at small-to-medium scale. A candles table with a composite primary key of (symbol, timeframe, open_time) and a UNIQUE constraint for upserts. It degrades as rows grow into the billions, which is why most serious systems move off it.
4. Redis/other caches in front of any of the above Candles are read far more often than written, so a hot cache (last N candles per symbol/timeframe) massively cuts DB load. This is almost always worth doing regardless of backing store.
(symbol, timeframe, open_time) — a just-closed candle gets corrected a few times by exchanges before finalizing, so you need idempotent writes, not pure appends.For most projects: Parquet in object storage for historical/research + TimescaleDB (or Postgres) for the live, queryable layer + Redis in front. If you're building a backtester/researcher, lean columnar. If you're building a live charting product, lean time-series with aggressive pre-aggregation and caching.
There's no single right answer — it's dictated by whether your workload is write-heavy (live ingestion) or read-heavy (serving charts/backtests), and by your scale. Want me to look up which crypto data APIs or exchanges expose the cleanest historical candle endpoints for whatever you're building?
Generated August 29, 2026 byCoinAII — not financial advice.