Analysing Data in Web3 with SQL
thisgoke.medium.com
thisgoke.medium.com
We also support scheduling, webhooks and a bunch more. I'm one of the founders (mike@luabase.com), let me know if you have questions!
> Clickhouse (instead of Postgres), so most queries are orders of magnitude faster.
is a bold statement. They designed very differently.
Try to do O(1) look up with a primary key and see which one is faster?
Clickhouse shine in batch queries where you retrieve multiple row at a time. Its 30x faster than Postgres from my benchmark
Clickhouse sucks when you need data integrity, primary key can be duplicated. People use MergeTree engine to dedupe, but even so, dedupe doesn't guarantee the absence of duplication primary key. So at query time you have to call Aggregate Function.
Inserting small data frequently will also make Clickhouse choke. You cannot simply have it accept random write. Always have to batch.
But good thing is ClickHouse has amazing integration with Postgres such as replication through logical replication, foreign data wrapper so you can query Postgres table inside Clickhouse
> Clickhouse sucks when you need data integrity, primary key can be duplicated. People use MergeTree engine to dedupe, but even so, dedupe doesn't guarantee the absence of duplication primary key. So at query time you have to call Aggregate Function.
Agreed. Fortunately we control the processes that insert data and can handle these issues during ingress.
> But good thing is ClickHouse has amazing integration with Postgres such as replication through logical replication, foreign data wrapper so you can query Postgres table inside Clickhouse
Yes! This was surprisingly easy. We set up a way[1] for users to connect their pg data in Luabase.
0 - https://tech.marksblogg.com/benchmarks.html
1 - https://luabase.notion.site/Postgres-c6abe018218d49348ad7549...
Woah woah dems fightin words. Is this true?
Results of query benchmarking between TimescaleDB [built on PostgreSQL] and ClickHouse. TimescaleDB outperforms in almost every query category
I don’t think that post says what you think it says ;-)(Disclaimer, Timescale co-founder)
if your usecase is one clickhouse can handle (timeseries/olap) most queries are orders of magnitude faster.
https://www.timescale.com/blog/what-is-clickhouse-how-does-i...
Disclaimer: Timescale co-founder
how much of timescale's performance would you say is inherited from PostgreSQL?
clickhouse is more generally olap and not suitable for oltp, you could call it an olap+timeseries solution similarly to how you position timescale as oltp+timeseries
You are correct, TimescaleDB is time-series + OLTP. But I would argue that ClickHouse is just OLAP, but is better at time-series than other OLAP. But maybe now I am splitting hairs (and my apologies if I am). how much of timescale's performance would you say is inherited from PostgreSQL?
The performance areas where TimescaleDB shines is mostly stuff we have built. But the reliability, tooling, and ecosystem are mostly inherited from Postgres (which I think is a very good thing)query Ethereum via RPC https://ethereum.org/en/developers/docs/apis/json-rpc/
or use a free one hosted one by Google: https://cloud.google.com/blog/products/data-analytics/introd...
there's also open-source Graph Protocol: https://github.com/graphprotocol
what kind of delay do you have between when the event occurs and when it's in the database?
Is this actually about some kind of Web3 Data Analytics or is this "I downloaded the entire block chain and parsed it into a relational database"?
When I was trying to do that, my local system could keep up only with doing writes, but not much more. What specs you need to have for that? I guess now its like 10tb of transactions in Ethereum, 1m transactions per day.
https://cloud.google.com/blog/products/data-analytics/introd...
storing billions of records in database is hard, but querying them is harder
if you want to try, get yourself some proper tools first: https://github.com/blockchain-etl
or you can just query transactions via RPC
Well thats one way to put it.