665 karma · joined April 16, 2020
I did sth pretty similar last month: https://rxdb.info/rx-storage-foundationdb.html
It supports indexes, mongoDB queries etc. to store and query JSON documents via RxDB on top of FoundationDB.
[1] https://mynoise.net/NoiseMachines/campingRainNoiseGenerator....
You can come to the RxDB discord for a chat if you want. I am really interessted in using WebAssembly for browser side storage.
I look forward to the day where someone reimplements IndexedDB via Webassembly, with the exact same API, so that we have a faster IndexedDB which uses the old one as storage layer :)
As far as I know, accessing IndexedDB from WebAssembly only works by passing the data through the JavaScript layer (correct me if I am wrong). So from how I think WebAssembly works, it is likely not any faster then directly doing that in JavaScript. I mean, the storage layer does not have to do any heavy computations, so tunneling the data would be more expensive then what you get from plain js.
When you store the data into an IndexedDB based key-value store, how does the querying work? Do you still use IndexedDBs secondary indexes when a query only matches a range of documents, or does the K-V store has any method to support querying a subset of the data without fetching the whole database state?
The other one is the "real" filesytem api, which is not supported by most browsers. [2]
[1] https://developer.mozilla.org/en-US/docs/Web/API/File_System...
For example when you run a Node.JS profiling on the PouchDB test suite, most CPU cycles are spend in running the clone() function.
Having an updated performance comparison of structuredClone() would be great.
The only way to lose data is when I shutdown power directly after a write.
It is also to mention that having everything in memory will not support multi-tab usage.
https://pubkey.github.io/client-side-databases/database-comp...