Live data from Hacker News

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

github.com

41–50 of 126 posts

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

#41

I have been developing something that provides this functionality for PostgreSQL: https://github.com/supabase/realtime It's still in very early stages (although I am using it in production for my company) It's very similar to Debezium (mentioned in another comment), but it's built with Phoenix (elixir), so great for listening via websockets. Basically the Phoenix server listens to PostgreSQL's replication functionali…

There is a big difference between the changestream of many SQL and noSQL databases, and what RxDB does. Having a stream of changes is useful but not the whole solution. RxDB is capable of using single document changes of a stream and recalculate the new results of an existing query. This saves you not only much IO performance but makes developing much easier. See https://rxdb.info/query-change-detection.html

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

#42
There is also (mine) https://github.com/amark/gun

It is run by Internet Archive, HackerNoon, DTube, Notabug, etc.

Handles about 8M monthly active users!

+ end-to-end encryption, graphQL & graph data, upcoming Svelte support, decentralized, etc.

MIT/Zlib/Apache2 licensed.

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

#43

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.

Firestore is doing something very similar and it is very easy to use.

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

#44
post #41

I have been developing something that provides this functionality for PostgreSQL: https://github.com/supabase/realtime It's still in very early stages (although I am using it in production for my company) It's very similar to Debezium (mentioned in another comment), but it's built with Phoenix (elixir), so great for listening via websockets. Basically the Phoenix server listens to PostgreSQL's replication functionali…

There is a big difference between the changestream of many SQL and noSQL databases, and what RxDB does. Having a stream of changes is useful but not the whole solution. RxDB is capable of using single document changes of a stream and recalculate the new results of an existing query. This saves you not only much IO performance but makes developing much easier. See https://rxdb.info/query-change-detection.html

Yeah perhaps "same functionality" is an ambitious statement. I just saw debezium mentioned below and thought i'd throw this out in case someone reading this and it fits their needs!

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

#45
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.

In reality data can't become private again, after being available. You may try to contact all users to delete their copy, but they may not respect that.

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

#46
post #30

If you want to subscribe to changes in a Postgresql database, whether produced by your app or not, you can also use Hasura or PostGraphile: https://docs.hasura.io/1.0/graphql/manual/subscriptions/inde... https://www.graphile.org/postgraphile/realtime/

I tried out Postgraphile Realtime and it's pretty cool.

For anyone who wants something similar that's not GraphQL, then I'm in the early stages of developing a Phoenix (Elixir) implementation which broadcasts changes over websockets: https://github.com/supabase/realtime

See comments here: https://news.ycombinator.com/item?id=21354039

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

#47

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.

Data security is a huge issue, Facebook.com has very specific whitelisted access patterns encoded as CRUD endpoints. 1) Users want to make sure their data is used in non-creepy or non-stalky ways; 2) Facebook's business needs to control the access point so they can serve you adds or otherwise monetize. So the API exposes only limited access patterns, the API TOS disallows caching, and they go to great lengths to prevent scrapers.

If immutable fact/datom streams with idealized cache infrastructure becomes a thing (and architecturally i hope it does) it's going to need DRM to be accepted by both users and businesses.

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

#48

There is also (mine) https://github.com/amark/gun It is run by Internet Archive, HackerNoon, DTube, Notabug, etc. Handles about 8M monthly active users! + end-to-end encryption, graphQL & graph data, upcoming Svelte support, decentralized, etc. MIT/Zlib/Apache2 licensed.

I read through your whole readme and I still am not able to answer the question: "what kind of project would I use GUN for?"

or, even, "what is gun replacing?"

I mean, it looks interesting and I would like to play around with it, but I don't understand enough to know what kind of stuff I can build with it.

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

#49

There is also (mine) https://github.com/amark/gun It is run by Internet Archive, HackerNoon, DTube, Notabug, etc. Handles about 8M monthly active users! + end-to-end encryption, graphQL & graph data, upcoming Svelte support, decentralized, etc. MIT/Zlib/Apache2 licensed.

I read through your whole readme and I still am not able to answer the question: "what kind of project would I use GUN for?" or, even, "what is gun replacing?" I mean, it looks interesting and I would like to play around with it, but I don't understand enough to know what kind of stuff I can build with it.

[deleted]

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

#50

There is also (mine) https://github.com/amark/gun It is run by Internet Archive, HackerNoon, DTube, Notabug, etc. Handles about 8M monthly active users! + end-to-end encryption, graphQL & graph data, upcoming Svelte support, decentralized, etc. MIT/Zlib/Apache2 licensed.

I read through your whole readme and I still am not able to answer the question: "what kind of project would I use GUN for?" or, even, "what is gun replacing?" I mean, it looks interesting and I would like to play around with it, but I don't understand enough to know what kind of stuff I can build with it.

I tried several times to understand what GUNdb does and how its different or which features it has. I have given up. As far as I can tell it is something between Blockchain, graph-database and sync.

I also tried to understand the codebase which is impossible with obfuscated code like this one: https://github.com/amark/gun/blob/master/lib/store.js#L16

Post reply on HN