Better HN
topnewbestaskshowjobs
Log inSign up

typingmonkey

665 karma · joined Apr 16, 2020 (6y ago) · 103 submissions

https://twitter.com/pubkeypubkey
Submissions

comment 4y ago · link · parent

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

32.

RxDB v13 Replication Protocol(github.com ↗)

5 points · by typingmonkey · 4y ago · discuss

comment 4y ago · link · parent

Sounds like the feature set of RxDB [1].

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

34.

Release Radar · January 2022 Edition(github.blog ↗)

3 points · by typingmonkey · 4y ago · discuss

35.

Alternatives for realtime offline-first JavaScript applications(rxdb.info ↗)

3 points · by typingmonkey · 4y ago · discuss

comment 4y ago · link · parent

The posting refers to "f/x". So yes this is illegal in germany.

37.

RxDB 11.0.0(github.com ↗)

6 points · by typingmonkey · 4y ago · discuss

comment 4y ago · link · parent

As I understood, they will directly begin to dismantel the plants. So there is no way back.

comment 4y ago · link · parent

Like telegram did with the translate api, there is also a way to have an unlimited api for search results. You have to find one of the old mobile pages of google.

comment 4y ago · link · parent

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

41.

EventReduce optimizes database queries that run multiple times(github.com ↗)

3 points · by typingmonkey · 4y ago · discuss

comment 4y ago · link · parent

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.

43.

Demystifying Storage for Web Apps(expressflow.com ↗)

2 points · by typingmonkey · 5y ago · discuss

comment 5y ago · link · parent

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

comment 5y ago · link · parent

LocalForage is similar slow as IndexedDB

https://pubkey.github.io/client-side-databases/database-comp...

46.

Why IndexedDB is slow and what to use instead(rxdb.info ↗)

105 points · by typingmonkey · 5y ago · 45 comments

comment 5y ago · link · parent

Is it possible to also expose a websocket that emits changes?

comment 5y ago · link · parent

Does DuckDB support multi tab usage? How big is the wasm file that must be loaded?

comment 5y ago · link · parent

I just described the world how it is. I did not create it, I did not made the browser. I do not understand your point. You want to complain about what exactly?

comment 5y ago · link · parent

The browser is an abstraction layer. It will always be slower. But all this does not matter because your user will not write 20 chat messages / second.

comment 5y ago · link · parent

Yes, this is exactly what is happening. But still you only have one CPU in JavaScript, so the GUI part will take the resources from the database part.

comment 5y ago · link · parent

> Syncing that local CouchDB to your web based CouchDB is very fast

This is not true. When you compare the CouchDB replication with other replication protocols, it is slow. The reason is that CouchDB supports replication with many instances at the same time. This creates big overhead in handling revision trees. Many requests have to be made all the time. You can observe that by starting the PouchDB subproject in the comparison repo. Watch the network tab in dev tools. Another problem is that CouchDB does not support Websocket replication, everything is long polling and plain http requests.

Other replications that only support many-clients-to-one-server are way faster. Both, on the initial load and on ongoing changes. This was the main reason why I build GraphQL replication for RxDB.

comment 5y ago · link · parent

Replication, Encryption, Conflict Handling, Multi-Tab-Support, Compression, Observability and many more..

comment 5y ago · link · parent

I wrote so much things and posted it on HN over the years. There is just no way to make everyone happy, someone always complains that some infos are missing or too much.

I now leave things out that can be googled and are already known by "most" readers.

comment 5y ago · link · parent

When you insert 20 messages, there is way more happening than 20 db writes. Each insert will affect the UI which will cause a layout change. Also the changes will be replayed in different browser tabs and might also be replicated to the backend. Then there is things like conflict resolution, validation and encryption. You just cannot compare these speeds with your MySQL insert operation.

comment 5y ago · link · parent

Yes RxDB conflict resolution is equal to PouchDBs. At least for now, there are plans to improve from there where you have a global resoluting function instead of listening for conflicts in the changestream.

comment 5y ago · link · parent

It is benchmarking the firestore JavaScript library that runs at the client.

comment 5y ago · link · parent

Author here.

I am using RxDB with Capacitor (iOS and Android app). You can use the SQLite based pouchdb adapter with capacitor. It keeps your data and is (sometimes) faster.

Here [1] I have documented a whole section about how to use RxDB+SQLite in Capacitor.

[1] https://rxdb.info/adapters.html

comment 5y ago · link · parent

I considered to add Supabase, RethinkDB and meteor. But they are not really client side databases. They realtime stream query results from the server to the client.
1234