HN user

typingmonkey

665 karma

https://twitter.com/pubkeypubkey

Posts16
Comments79
View on HN

Fair point. From my experience people often think ipfs works equal to sth like a shared drive or filecoin, so I had to point that out.

You cannot "put stuff" on ipfs. Either you seed it or someone else does. If noone seeds it, it is gone. I bet most of it will be offline in 3 months.

Ok now I understand.

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 :)

Thank you for these links, I will inspect that.

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?

I am developing a web/JavaScript database for several years now [1]. What I do not understand is, how graph based databases, (like surrealDB or gundb) plan to have great performance when they run in the browser. The thing is that you are always limited to store your data inside of the browsers IndexedDB. So as soon as you do not work with the same document-based model similar to the IndexedDB API, you will have big troubles when it comes to performance. For example how can you store and query graph based data in IndexedDB without heavily overfetching either on read or on writes? IndexedDB is already way too slow.

[1] https://github.com/pubkey/rxdb

I can totally relate to that. When designing the RxDB GraphQL replication [1] protocol, it made things so much easier when the main data runs via normal request-response http. Only the long-polling is switched out for WebSockets so that the client can know when data on the server has changed. This makes it realy easy to implement the server side components when having a non-streaming database.

[1] https://rxdb.info/replication-graphql.html

Whenever I research the performance problem of a JavaScript library, I stumble over many deep clones even when it is not necessary most of the time. People are just not aware how CPU expensive a deep clone in JavaScript is, even more on big objects.

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.

I analyzed [1] that problem and tried to reproduce data loss with LokiJS, which also has everything in memory and only partially writes to disc. It is very hard to reproduce a loss. You can call the saveDatabase() when the window 'unload' event fires and also after each write when the database is idle again. This works quite reliable.

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.

[1] https://rxdb.info/slow-indexeddb.html