Live data from Hacker News

DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

duckdb.org

141–150 of 167 posts

Re: DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

#141

Can multiple separate clients access the same single-file database at the same time?

One of the DuckDB authors here. The answer is yes, but only in read-only mode at the same time.

What about one single client writing and multiple clients in read-only mode? Any problems with storing the file on network storage? Basically, how far can you push it before it is better to just use PostgreSQL?

Re: DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

#143

Earlier quoted context omitted.

How would that be different from someone editing something in window.localStorage?

If that's all you need, it wouldn't make sense to include SQLite in the browser. If you're going to include a relational database you might as well use it

I think that meant: How would that be more of a security nightmare than some malicious site editing your browser's whatever.localstorage?

Re: DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

#144
post #66
post #51

Earlier quoted context omitted.

And if you need to run expensive migrations, use a template database. https://www.postgresql.org/docs/current/manage-ag-templatedb...

While PostgreSQL templates allow to scaffold new databases (one per test-spec) quite fast, it's even faster to have a warmed up pool of databases ready: https://github.com/allaboutapps/integresql#background Disclaimer: author.

Oh that looks great, and very close to what I had in mind for the next upgrade of our in-house testing framework. Definitely going to give that a try soon. Thanks for posting it!

Re: DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

#145

A suggestion for the web site: It would be good to mention the license more prominently. I had to click through to Github to find out what it was, and I believe this information would matter to more people than just me.

Dunno if this was put up in reaction to your comment, or you missed it, but looking at their front page right now it says “Permissive MIT License”.

Re: DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

#146

A suggestion for the web site: It would be good to mention the license more prominently. I had to click through to Github to find out what it was, and I believe this information would matter to more people than just me.

Correction: As CRConrad, whose comment was inexplicably downvoted, pointed out, the MIT License IS mentioned on the front page (And the Wayback Machine proves it was mentioned before the HN post).

Re: DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

#147

Earlier quoted context omitted.

Before the latest optimization, and only using 1 core, vs. SQLite we were seeing 133x performance on a basic group by or join, and about 4x for a pretty complex query. It was roughly even to Pandas in performance, but it can scale to larger than memory data and now it can use multiple cores! As an example, I could build views from 2 Pandas DataFrames with 2 columns and 1 million rows each, join them, and return the 1…

How about the other way? When will SQLite perform better than DuckDB?

If your workload is lots of singular INSERT or UPDATE’s.

Re: DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

#148

Earlier quoted context omitted.

OLAP databases can/are still Relational databases. The difference is that they’re optimised for different workloads. SQLite/MySQL/Postgres/MSSQL etc are all OLTP databases whose primary operation is based around operations on single (or few) rows. OLAP databases like ClickHouse/DuckDB, Monet, Redshift, etc are optimised for operating on columns and performing operations like bulk aggregations, group-bys, pivots, etc…

I gather that there may be some differences in functionality offered, but that it’s probably not much. So I presume performance is the biggest area of difference. In that regard: how big are the differences in performance for each category’s representative workloads?

To add to the other comment (albeit with different DB’s because I haven’t used DuckDB yet) comparing MSSQL and Clickhouse: similar hardware and same dataset, CH responds in ~30-60ms, MSSQL 300-400+ ms for simpler queries. 90-180ms vs several seconds, up to about 30s for more complex queries.

I could add more indices to MSSQL and do all sorts of query optimisations, but out of the box the OLAP wins hands down for that workload.

Re: DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

#149

Earlier quoted context omitted.

I gather that there may be some differences in functionality offered, but that it’s probably not much. So I presume performance is the biggest area of difference. In that regard: how big are the differences in performance for each category’s representative workloads?

Before the latest optimization, and only using 1 core, vs. SQLite we were seeing 133x performance on a basic group by or join, and about 4x for a pretty complex query. It was roughly even to Pandas in performance, but it can scale to larger than memory data and now it can use multiple cores! As an example, I could build views from 2 Pandas DataFrames with 2 columns and 1 million rows each, join them, and return the 1…

Have you compared this to dask from a performance standpoint? That is the larger than memory solution we're currently using for analytics.

Re: DuckDB – An embeddable SQL database like SQLite, but supports Postgres features

#150
Simple, embedded database deserve more attention, especially those with native language support, e.g. map,filter,reduce methods on wrapped data that behave similar to javascript array; and support to nested data structure (like auto join and normalize).

(I made one using Proxy API, called ref-db. The cons is it require manual indexing to speed up lookup by non-primary key)

Post reply on HN