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.
Rxdb: A reactive database where you can subscribe to the result of a query
11–20 of 126 posts
Re: Rxdb: A reactive database where you can subscribe to the result of a query
#12Having 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.
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
#13Re: Rxdb: A reactive database where you can subscribe to the result of a query
#14Re: Rxdb: A reactive database where you can subscribe to the result of a query
#15Isn'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?
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
#16EDIT: never mind, I should have read the article.
Re: Rxdb: A reactive database where you can subscribe to the result of a query
#17See also Noria: https://notamonadtutorial.com/interview-with-norias-creator-... . EDIT: never mind, I should have read the article.
Re: Rxdb: A reactive database where you can subscribe to the result of a query
#18I'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?
Re: Rxdb: A reactive database where you can subscribe to the result of a query
#19See 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
#20Isn'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?