Live data from Hacker News

Comparing ClickHouse to PostgreSQL and TimescaleDB for time-series data

blog.timescale.com

141–150 of 184 posts

Re: Comparing ClickHouse to PostgreSQL and TimescaleDB for time-series data

#141
post #89
post #17

There is some creative engineering going here :) have a look: https://github.com/timescale/tsbs/blob/master/scripts/load/l... vs https://github.com/timescale/tsbs/blob/master/scripts/load/l...

> There is some creative engineering going here Agreed. At a previous work, clickhouse outperformed timescale by several orders of magnitude, under about every condition. The timescale team seems to recognize that (look for the comment about clickhouse being a bulldozer) but they seem to say timescale can be better suited. In my experience, in about 1% of the cases, yes, timescale will be a better choice (ex: if you…

> In my experience, in about 1% of the cases, yes, timescale will be a better choice (ex: if you do very small batches of insertions, if you need to remove some datapoints) but in 99% of the usecases for a time series database, clickhouse is the right answer.

I always find comments like this interesting :-). Things are better for different use cases. If you find yourself inserting a lot of data in batches for OLAP-style analysis, then ClickHouse is a better choice today.

If you find yourself performing a lot of time-series related queries, and needing to build an application on top (e.g., where you might want the OLTP features of Postgres), then Timescale is the better choice.

YMMV! And that's OK :-)

> But in 2021, clickhouse vs timescale for a timeseries is like postgres vs mongo for a regular database: unless you have special constraints [*], the "cool" solution (timescale or mongo) is the wrong one.

This is also a funny statement, because TimescaleDB is built on PostgreSQL.

We actually take great pride in being a "boring" option [0] - in fact I think TimescaleDB is many ways is more "boring" than ClickHouse (again, because of its PostgreSQL foundation). But I think that's actually a good thing - because you should want your database to be "boring" - ie you shouldn't have to worry about it!

(Disclaimer: TimescaleDB co-founder)

[0] https://blog.timescale.com/blog/when-boring-is-awesome-build...

Re: Comparing ClickHouse to PostgreSQL and TimescaleDB for time-series data

#142

Earlier quoted context omitted.

This does not answer the question - is it Open Source License or Source Available (TSL) https://www.timescale.com/legal/licenses

the original article and the parent poster say that the community edition was used: > Versions: TimescaleDB version 2.4.0, community edition, with PostgreSQL 13 and the link you posted explains that it's the non OSI license version: > TimescaleDB Community is made available under the Timescale License ("TSL")

Tnx. I think this is another thing which worth to point out. We're having Open Source solution compared with non Open Source one.

Re: Comparing ClickHouse to PostgreSQL and TimescaleDB for time-series data

#143

If you have thousands of clients writing to the database individual rows, one per request, and thousands of clients making queries (some of them are complex, some are not). Does ClickHouse even get used in this scenario?

Yes but typically with some sort of batching proxy in front of it

e.g. https://clickhouse.com/docs/en/interfaces/third-party/proxy/

Re: Comparing ClickHouse to PostgreSQL and TimescaleDB for time-series data

#144
post #136

I’m surprised Timescale hasn’t given a comparison with SingleStoreDB. I’ve found SingleStore column scans at parity with ClickHouse in speed. At same time SingleStore uses a hybrid skip-list, columnstore data structure in their universal storage (which is default table format). So you have high throughput transactions, as well as insanely fast aggregate scans. Usually in column stores, they are great at append, not s…

Beyond being closed source, SingleStoreDB's License explicitly prohibits benchmarking:

https://www.singlestore.com/assets/contracts/singlestore-fre...

2. Restrictions. You acknowledge that the Software, and its structure, organization, and source code, constitute SingleStore’s and its suppliers’ valuable trade secrets, and the Software is subject to the following restrictions. Specifically, Customer shall not, and shall not ... conduct any competitive analysis, publish or share with any third party any results any results of any technical evaluation or benchmark tests performed on the Software, or disclose Software features, errors or bugs to a third party without SingleStore’s prior written consent (“Benchmarking”); or

Re: Comparing ClickHouse to PostgreSQL and TimescaleDB for time-series data

#145

Disclaimer: I'm a co-founder of https://logtail.com , ClickHouse-based hosted log management platform. PostgreSQL, TimescaleDB, and ClickHouse are all impressive pieces of software. We use both PostgreSQL and ClickHouse at Logtail. ClickHouse shines for true OLAP use-cases and is very hard to beat performance-wise when configured properly. Example: > Poor inserts and much higher disk usage (e.g., 2.7x higher disk usa…

> 2.7x higher disk usage than TimescaleDB ...

A classic tenet of computer science is that you can trade speed for space and vice versa. A database index is an example of this concept.

While the article complains about "benchmarketing", its tone is rather dismissive of ClickHouse and parts such as this line caught my eye as unfair.

Re: Comparing ClickHouse to PostgreSQL and TimescaleDB for time-series data

#146
post #89

Earlier quoted context omitted.

> There is some creative engineering going here Agreed. At a previous work, clickhouse outperformed timescale by several orders of magnitude, under about every condition. The timescale team seems to recognize that (look for the comment about clickhouse being a bulldozer) but they seem to say timescale can be better suited. In my experience, in about 1% of the cases, yes, timescale will be a better choice (ex: if you…

> In my experience, in about 1% of the cases, yes, timescale will be a better choice (ex: if you do very small batches of insertions, if you need to remove some datapoints) but in 99% of the usecases for a time series database, clickhouse is the right answer. I always find comments like this interesting :-). Things are better for different use cases. If you find yourself inserting a lot of data in batches for OLAP-st…

> This is also a funny statement, because TimescaleDB is built on PostgreSQL.

I know, but doing timeseries with postgres is "cool", not standard, not boring. I'd even say "risky".

> We actually take great pride in being a "boring" option

No, you're not there yet: doing timeseries with timescale is way riskier than with clickhouse, which is both a bit older (not much) and more mature (much more), while also being more widely used (even if you are doing a lot of outreach like these posts)

Re: Comparing ClickHouse to PostgreSQL and TimescaleDB for time-series data

#147

Disclaimer: I'm a co-founder of https://logtail.com , ClickHouse-based hosted log management platform. PostgreSQL, TimescaleDB, and ClickHouse are all impressive pieces of software. We use both PostgreSQL and ClickHouse at Logtail. ClickHouse shines for true OLAP use-cases and is very hard to beat performance-wise when configured properly. Example: > Poor inserts and much higher disk usage (e.g., 2.7x higher disk usa…

Could you explain what you mean by ops heavy? Just curious. Actually have a production system where Timescale as well as clickhouse are running in parallel. So far clickhouse didn't do any trouble, but it is rarely used right now.

It is not ops heavy. I believe they are trying to sell you on a managed service with that sentence. It is in your best interest for your team to learn how to maintain ClickHouse themselves. The k8s operator will take you far. By the time you need multi-node clusters you will already have a good idea of how it works. If you need a multi cluster deployment from the start then go with some consulting service I guess, but even then I wouldn’t call it “ops heavy”; the clusters are pretty homogeneous, just a bunch of nodes talking over ZK.

Re: Comparing ClickHouse to PostgreSQL and TimescaleDB for time-series data

#148
post #146

Earlier quoted context omitted.

> In my experience, in about 1% of the cases, yes, timescale will be a better choice (ex: if you do very small batches of insertions, if you need to remove some datapoints) but in 99% of the usecases for a time series database, clickhouse is the right answer. I always find comments like this interesting :-). Things are better for different use cases. If you find yourself inserting a lot of data in batches for OLAP-st…

> This is also a funny statement, because TimescaleDB is built on PostgreSQL. I know, but doing timeseries with postgres is "cool", not standard, not boring. I'd even say "risky". > We actually take great pride in being a "boring" option No, you're not there yet: doing timeseries with timescale is way riskier than with clickhouse, which is both a bit older (not much) and more mature (much more), while also being more…

> No, you're not there yet: doing timeseries with timescale is way riskier than with clickhouse, which is both a bit older (not much) and more mature (much more), while also being more widely used

This is not true at all, and we explain why in the post:

1. TimescaleDB's reliability is PostgreSQL's reliability. ClickHouse has a lot of advantages, but "more reliable than PostgreSQL" is not one of them.

From the post:

  PostgreSQL has the benefit for 20+ years of development and usage, which has resulted in not just a reliable database, but also a broad spectrum of rigorously tested tools: streaming replication for high availability and read-only replicas, pg_dump and pg_recovery for full database snapshots, pg_basebackup and log shipping / streaming for incremental backups and arbitrary point-in-time recovery, pgBackrest or WAL-E for continuous archiving to cloud storage, and robust COPY FROM and COPY TO tools for quickly importing/exporting data with a variety of formats. This enables PostgreSQL to offer a greater “peace of mind” - because all of the skeletons in the closet have already been found (and addressed).
2. ClickHouse, being a newer database, still has several "gotchas" with reliability: e.g., No data consistency in backups (because of its lack of support for transactions and asynchronous data modification)

From the post:

  One last aspect to consider as part of the ClickHouse architecture and its lack of support for transactions is that there is no data consistency in backups. As we've already shown, all data modification (even sharding across a cluster) is asynchronous, therefore the only way to ensure a consistent backup would be to stop all writes to the database and then make a backup. Data recovery struggles with the same limitation.

  The lack of transactions and data consistency also affects other features like materialized views because the server can't atomically update multiple tables at once. If something breaks during a multi-part insert to a table with materialized views, the end result is an inconsistent state of your data.

Now this trade-off - accepting less reliability for faster OLAP queries - may be fine with you. And that's OK. But stating that ClickHouse is more reliable than PostgreSQL/TimescaleDB is just not true.

Re: Comparing ClickHouse to PostgreSQL and TimescaleDB for time-series data

#149
post #75

Earlier quoted context omitted.

So services like Sentry / Honeybadger / etc probably use this architecture?

I think most online logging SaaS services actually use ElasticSearch.

StackGres by Ongres, which achieved 1.0.0 status today, is another example of someone storing logs in TimescaleDB:

https://twitter.com/ongresinc/status/1451194886795849742

(Also, thank you GordonS for the kind words!)

Re: Comparing ClickHouse to PostgreSQL and TimescaleDB for time-series data

#150
post #18

Can someone give me a real-world example of a scenario where they actually need a time series database, like an example query with the business use case / justification? Just super curious.

I build TSDB (10,000,000 samples per seconds and average query time is almost 200ms) over clickhouse which support multi insert protocol (influxdb line protocol|prometheus remote write|opentsdb json format) and opentsdb query protocol and incomplete PromQL. Clickhouse is good but something you need to tunning. using memory table to speedup insert,high performance zookeeper to improve replicated table, data shard via timeseries id (distributed_group_by_no_merge=1) to reduce bootstrap node load
Post reply on HN