ankoh
...but then the OPFS will be a quite decent fit. We (DuckDB-Wasm) are also looking closely at OPFS.
IMHO the requirement here is not even to get to full ACID.
With OPFS, we will get close enough to IndexedDB on steroids and bypassing the js heap limits through out-of-core operators.
After all, we are still running in a browser.
So I see the value of Wasm-based databases to be a front-facing accelerator, not a substitute for robust storage solutions.
But I'm happy to discuss this further if you have any suggestions.
We faced many of them ourselves but paused any further work on an IndexedDB-backend due to the lack of synchronous IndexedDB apis (e.g. check the warning here https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase...). He bypasses this issue using SharedArrayBuffers which would lock DuckDB-Wasm to cross-origin-isolated sites. (See the "Multithreading" section in our blog post)
We might be able to lift this limitation in the future but this has some far-reaching implications affecting the query execution of DuckDB itself.
To the best of my knowledge, there's just no way to do synchronous persistency efficiently right now that wont lock you to a browser or cross-origin-isolation. But this will be part of our ongoing research.
Querying CSV files is particularly painful over the network since we still have to read everything for a full scan.
With Parquet, you would at least only have to read the columns of group by keys and aggregate arguments.
Try it out and share your experiences with us!
The blog post contains a few examples how this can be used, for example, to partially query Parquet files over the network.
E.g. just visit shell.duckdb.org and enter:
select * from 'https://shell.duckdb.org/data/tpch/0_01/parquet/orders.parqu...' limit 10;
It's targeting use cases where you want to push analytical computation away from servers into the client (browser).
Lets me sketch 2 examples:
A) You have your data sitting in S3 and the user-specific data is in a browser-manageable area.
(E.g. this paper from Tableau research actually states dataset sizes that should fall into that category: https://research.tableau.com/sites/default/files/get_real.pd...)
In that scenario, you could eliminate your central server if your clients are smart enough.
B) You are talking about larger dataset sizes (GB) and want to explore them ad-hoc in your browser.
Uploading them is unrealistic and installing additional software is no longer ad-hoc enough.
Regarding multi-tab usage: Not today. The available filesystem apis make it difficult to implement this right now. We're looking into ways to make DuckDB-Wasm persistent but we can only read in this release.