4 ms·
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 b
by lukevp 6y ago
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 on top of couch/pouch, and the biggest pain points were:
1. Pouchdb was before async/await and typescript. The typings can be inconsistent, and it’s very difficult to properly manage the lifetimes of local databases because of the promise chaining.
2. A database technology for Real time replication Needs ACLs on a per-document basis. I built provisioning scripts to manage separate databases per user, as suggested, and it’s very cumbersome. It prevents me from lots of data sharing models like promoting one record to public view, or sharing a record with another user in a different tenant.
3. Personally I feel that the naming / marketing of the product is poor. It does not feel professional ( couch, futon, fauxton, pouch, couchbase) do not feel like professional grade products I can depend on to run a business.
I think it would be good for RxDB to support its own backend technology and move away from PouchDB, and in the meantime, de-emphasize the relationship with PouchDB. The RxDB product doesn’t require you to use PouchDB and at this point it’s got a lot of buzz around it and doesn’t need that tie to PouchDB to continue.
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). The data layer should allow me to specify the durability requirements of each write (down to the specific entity type) and enforce an atomic commit on all related records in one transaction at the level of the most strict entity in the commit. It should be trivial to shard because the syncing protocol the clients use itself should be available to the server. Multitenancy should be built in. It should support real-time ephemeral in memory data for collaboration/chat scenarios, with optional durability that’s eventually consistent. Schema definitions and migrations should be built in to the product.
If you have similar ideas and are interested in working with me on this project, or hearing more, drop me a line.
- typingmonkey 6y agoActually, the long term plan is to move away from pouchdb. Before the last major release [1] I decided to make RxDB useable with other frontend/backend databases but then found out that I first should refactor some pain points. [1] https://github.com/pubkey/rxdb/issues/1636 https://github.com/pubkey/rxdb/issues/1636
- lukevp 6y agoThat’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.
- typingmonkey 6y agoI 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/introduction/ https://hasura.io/learn/graphql/react-rxdb-offline-first/int...
- adav 6y agoCool! I was just thinking that RxDB + Hasura would be pretty nifty for an offline-first MVP and here the legwork has already been done :)
- kiwicopple 6y agoHey 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.
- k__ 6y agoAh, 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.
- typingmonkey 6y agoNo 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.
- MuffinFlavored 6y ago> 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?
- lukevp 6y agoRxDB 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.
- thomasfedb 6y agoIf you could document your experience with Pouch/Couch that would be excellent. I've considered using the stack for a offline-first SPA but the curve seem so steep, particularly the database creating, proxying, etc required to make Couch behave with many clients.
- jamil7 6y ago> 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 get you 90% of the way there but surprisingly little that ticks all the boxes.
- lukevp 6y agoI'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.