5 ms·
This is so, so interesting. There have been lots of discussions about PouchDB and GunJs but they always seemed limited in the backend story. I've been trying to
by xrd 6y ago
This is so, so interesting. There have been lots of discussions about PouchDB and GunJs but they always seemed limited in the backend story. I've been trying to get Couchdb to work with my own proxies for about a year and it is a big pain point. But, the real time synchronization and offline support is so compelling with those stacks. Thinking in documents and only about your front end code (letting the library do the hard work of synchronization) removes a lot of stress.
Using postgresql alone would make this super exciting. Adding graphql takes it to "giddy" level for me.
Is there a story for offline support? Is there perhaps a react library that could help here? The tutorial uses subscriptions, wonder what happens when the app goes offline?
This is so amazing. I'm going to play with it and Svelte and see how it goes.
Well done!
- typingmonkey 6y agoYou should try RxDB. It is based on pouchdb and therefore supports offline first [1]. Also you can use the graphql replication so that you are not limited to couchdb backend. Also there is a course made by hasura about using RxDB with their backend [2] disclaimer: I made RxDB [1] https://github.com/pubkey/rxdb https://github.com/pubkey/rxdb [2] https://hasura.io/learn/graphql/react-rxdb-offline-first/introduction/ https://hasura.io/learn/graphql/react-rxdb-offline-first/int...
- juliushuijnk 6y agoCan it do 'offline first for couple of months'? Use case I'm thinking about: - At first the mobile app has no account, db is used without online backend. - Then user pays for premium features including online backup/sync. - This user then is created and all the data will be put in the online db and syncs, etc. - No local SQLite db or anything needs to sync, because you have this offline first database, that can handle offline only. This seems like an obvious use case to me, but have had trouble figuring out best path forward.
- typingmonkey 6y agoYes. It can even work fully without any server synchronization. It is just a db in the browser, sync is optional.
- juliushuijnk 6y agoThanks for responding, meant for inside a mobile phone app, but I'll assume it can also be used for that then.
- kall 6y agoThere are react libraries that offer a basic level of offline support (urql, apollo). You can maybe query data you already have cached, perform mutations and optimistically update the cache offline while the update is hopefully queued (maybe persistent across restarts?) until you go back online. Nothing close to couchbase or realm sync though.
- gedy 6y ago> Is there a story for offline support? Is there perhaps a react library that could help here? If the interface is graphql, you should be able to use Apollo Client[0] which has offline support. [0] https://www.apollographql.com/docs/react/ https://www.apollographql.com/docs/react/
- jamil7 6y agoLast I checked Apollo had a persistent cache but not true offline support.
- gedy 6y agoDepends on what you mean by offline, but we're able to interact with UI and trigger mutations while offline, and it will replay the graphql calls in correct order once online again.
- jamil7 6y agoOh! That’s impressive I think last time I used it mutations couldn’t be triggered offline.
- yencabulator 6y agoWith Firestore, even when offline you still see your edits in your query results (flagged as such). This cannot be done with GraphQL, as the meaning of a GraphQL mutation is arbitrary, so the client can't change the offline query results accordingly.
- Graphguy 6y agoIf you haven't, you should join the CouchDB slack. People there are quite helpful. https://couchdb.apache.org/#chat https://couchdb.apache.org/#chat
- atmosx 6y ago> I've been trying to get Couchdb to work with my own proxies for about a year and it is a big pain point. Can you please elaborate? What are you trying to do and why it's a pain? I'm planning to use it for a side-project, the first in a long time, and I'm trying to wrap my head around it.