Live data from Hacker News

RxDB – a real-time database on top of PouchDB

github.com

41–48 of 48 posts

Re: RxDB – a real-time database on top of PouchDB

#41
post #35
post #33

Earlier quoted context omitted.

In-flight business objects for major airlines is probably considered scale: https://www.couchbase.com/customers/united-airlines

that's CouchDB, not PouchDB. PouchDB is a JavaScript implementation of CouchDB.

I was referring to the pattern and scaling issue the parent described, which are largely overcome in mature implementations.

Re: RxDB – a real-time database on top of PouchDB

#42
post #40

Earlier quoted context omitted.

It runs fully on the client and is offline first. A listener to PostgreSQL will not work when the device goes offline.

Fair enough, so what about triggers on a sqlite db on the client?

There is a big difference between having a changestream of writes to the database, and observing results of multiple queries.

Re: RxDB – a real-time database on top of PouchDB

#43

Earlier quoted context omitted.

If you wanted to be pedantic, nothing is real-time not even what you see with your eyes due to photon latency. The word is clearly being used colloquially

It is used clearly in a misleading way since this database is nowhere about latencies and time at all.

I know few people that use "realtime" to mean it in the "realtime OS" sense. It's usually used in layman's terms to mean "happening live".

RxDB isn't being misleading, it's another valid usage of the term.

Re: RxDB – a real-time database on top of PouchDB

#44
post #14

Earlier quoted context omitted.

Ah, nice. Does it work with AppSync? It seems to me that Amplify/DataStore is a product like RxDB, and they use AppSync as backend. Edit: I just saw it seems to integrate custom GraphQL, so it probably a direct competitor to DataStore in that regard.

No it does not work with appsync, but it could be hacked into doing that by modifiing the GraphQL plugin. There would be a huge value in replacing the aws datastore mainly because of its missing basic features like complex queries or queries with sort params.

I also would be highly interested in picking up RxDB if it can integration with either AppSync or PostgreSQL. I guess with the later- would it be possible to use RxDB with the GraphQL plugin against Postgraphile? Feels like a lot of 'magic', but it would be great something like this just worked.

Re: RxDB – a real-time database on top of PouchDB

#45
I've experimented with RxDB in a side project of mine, a spaced-repetition web app that is designed to be usable offline, with background sync between clients. The offline-first requirement meant using something like IndexedDB to store state client-side, which is where RxDB comes in.

Overall I like the library. It makes the hard task of interacting with IndexedDB a lot more pleasant. The GraphQL support is also a nice touch. Coupled with something like Hasura, it took me like a day to get sync working.

My one criticism with RxDB specifically is that the documentation around writing queries can be a bit hit-or-miss.

Re: RxDB – a real-time database on top of PouchDB

#46
post #9

The concept or RxDB, being able to iterate observables of your change stream, is great. Centering on schemas and typescript is as well. The broadcast channel based leader election also solved the common issue with Pouch where you can’t respond to real-time changes and update your UI if a separate tab was watching too. It’s wise of them to also support pulling data from GraphQL. I built the first version of NoteBrook…

> The concept or RxDB, being able to iterate observables of your change stream Why can't this be done with a thin wrapper around Postgres pub/sub + triggers?

RxDB is using RxJS and is meant for building an observable DB on the client side (i.e. it has local data and works offline). If you were using it server-side with Node, it wouldn't be as compelling.

Re: RxDB – a real-time database on top of PouchDB

#47
post #37
post #9

The concept or RxDB, being able to iterate observables of your change stream, is great. Centering on schemas and typescript is as well. The broadcast channel based leader election also solved the common issue with Pouch where you can’t respond to real-time changes and update your UI if a separate tab was watching too. It’s wise of them to also support pulling data from GraphQL. I built the first version of NoteBrook…

> I feel an ideal library would offer a real-time and offline client db, user auth, and billing, tied to a backend database of my choosing (eg. Postgres, MariaDB). I've been searching for something like this for a really long time (specifically in the context of mobile but web would also be great). For the last project I settled on Realm and their sync service (not entirely open source). There's a lot of things that…

I've also gone through this process and evaluated Firebase, Realm, Pouch/Couch... They all ultimately fall down at some point and you end up in a situation where you have to build some strange hybrid with a separate API to do the features that aren't supported, and you can't really use them as full MBaaS like you'd hope.

Send me an e-mail from the info in my profile, and I'll include you in the alpha test! I would really appreciate some additional feedback.

Re: RxDB – a real-time database on top of PouchDB

#48
post #12

Earlier quoted context omitted.

That’s great to hear! Are you pubkey? If so you should put that in your profile! I hope you know that I think RxDB is a great lib and going in a good direction! I recommended it to the Supabase team a couple weeks ago. I am less long PouchDB, it feels like an old generation of this tech and not the best way to solve these problems in 2020.

I updated my profile. I do not know supabase, is it similar to hasura? They spend quite some effort [1] to make the RxDB graphql replication working with their backend. Maybe supabase can use a similar wrapper over GraphQL. [1] https://hasura.io/learn/graphql/react-rxdb-offline-first/int...

Hey there, I'm the CEO of Supabase - we're pretty new (YC S20).

We've been considering using RxDB. I'm especially excited about the changes you have planned for the next version. I'd love to chat whenever you have time - my email is in my profile.

Post reply on HN