back

by yamrzou·5y ago·view on hn ↗
Another side question, please.

How does TimescaleDB compare to Clickhouse? Since you mentioned compression, I've been using Clickhouse to store bitemporal data, and have been amazed by its speed and compression levels. Unfortunately it's lacking in terms of relational modeling.

Would I get the best of two worlds with TimescaleDB? What are the tradeoffs?

1 comments
Compression and aggregation performance in TimescaleDB is much worse than ClickHouse - it represents a different tradeoff, you trade relational features for raw speed.

TimescaleDB is basically (very) fancy PostgreSQL sharding and row-oriented, while ClickHouse is a column store.

Depending on what you need to do, ClickHouse dictionaries and JOINs might be good enough.

> Compression and aggregation performance in TimescaleDB is much worse than ClickHouse

You are likely basing this off on an old version of TimescaleDB.

For the last year TimescaleDB has included native compression (in part by storing data in a columnar format):

https://blog.timescale.com/blog/building-columnar-compressio...

TimescaleDB now implements delta-delta, Gorilla, and other best-in-class compression algorithms:

https://blog.timescale.com/blog/time-series-compression-algo...

This has yielded 94%+ compression, which should make TimescaleDB and Clickhouse fairly similar in storage compression.

There is no technical tradeoff here. PostgreSQL could add a batched, vectorized and JITed execution engine, and ClickHouse could add "relational features". Either one would of course be a significant engineering project, but there is no fundamental breakthrough required. A small matter of programming as they say.