Live data from Hacker News

Rxdb: A reactive database where you can subscribe to the result of a query

github.com

11–20 of 126 posts

Re: Rxdb: A reactive database where you can subscribe to the result of a query

#11
post #10

Having client state just be a replica of server state solves so many problems I don't understand why the concept never caught on. Pouchdb/couchdb are still the only ones doing it afaik. Instead we have a bajillion layers of CRUD all in slightly different protocols just to do the same read or write to the database.

When your data is public and immutable, this approach is very pleasant. The client becomes just another caching layer and worst case it's presenting a historical version of the truth. You can even extend this across tabs with things like local storage. This breaks down quickly once you have data that could become private or mutate rather than append.

I think the Firebase Realtime Database and Firestore have a good model for offline and being able to have private and mutable data. It does get complex but the Firebase SDKs do the heavy lifting for you here.

Re: Rxdb: A reactive database where you can subscribe to the result of a query

#12
post #10

Having client state just be a replica of server state solves so many problems I don't understand why the concept never caught on. Pouchdb/couchdb are still the only ones doing it afaik. Instead we have a bajillion layers of CRUD all in slightly different protocols just to do the same read or write to the database.

When your data is public and immutable, this approach is very pleasant. The client becomes just another caching layer and worst case it's presenting a historical version of the truth. You can even extend this across tabs with things like local storage. This breaks down quickly once you have data that could become private or mutate rather than append.

This what stopped me exploring couchdb further.

The "one db per user" model for private data made using other features like views etc more difficult when you have to upgrade,edit,remove them.

Mutability wasn't really a problem, either present the conflicts to user and pick one or write code to merge if possible.

Re: Rxdb: A reactive database where you can subscribe to the result of a query

#15
post #14

Isn't "subscribe to all state-changes like the result of a query" something you'd implement efficiently using a forward chaining inference engine, like something based on Rete?

It is implemented with something called QueryChangeDetection here. https://rxdb.info/query-change-detection.html

This is based on meteors oplog-observe-driver https://github.com/meteor/docs/blob/version-NEXT/long-form/o...

So basically when a change-event comes, RxDB does not run the query against the database again, but instead uses the old results together with the event to calculate the new results.

Re: Rxdb: A reactive database where you can subscribe to the result of a query

#17

See also Noria: https://notamonadtutorial.com/interview-with-norias-creator-... . EDIT: never mind, I should have read the article.

I'm sorry but I think you comment is spam. The product in your article has only one similarity with RxDB which is being a database.

Re: Rxdb: A reactive database where you can subscribe to the result of a query

#18

I'm not sure why you would use this over something more battle-tested like RethinkDB which was also built with this use-case in mind.

Because rethinkdb development has ceased? Last release was in 2017. Is there still maintenance?

Why not maintain it rather than writing something new? Open source is frustrating

Re: Rxdb: A reactive database where you can subscribe to the result of a query

#19
post #17

See also Noria: https://notamonadtutorial.com/interview-with-norias-creator-... . EDIT: never mind, I should have read the article.

I'm sorry but I think you comment is spam. The product in your article has only one similarity with RxDB which is being a database.

You're right, sorry. I didn't click on the link and thought it was something else. I can't delete my comment, unfortunately.

Re: Rxdb: A reactive database where you can subscribe to the result of a query

#20
post #14

Isn't "subscribe to all state-changes like the result of a query" something you'd implement efficiently using a forward chaining inference engine, like something based on Rete?

I don't know too much about database systems, but if we were in an inference (e.g., production) system, then that would make a lot of sense! I build logical inference systems and have implemented this kind of functionality in forward, backward, and bi-directional logical inference.
Post reply on HN