Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Offline-first support #1659

Closed
sebastianmacias opened this issue Jan 16, 2018 · 10 comments
Closed

Offline-first support #1659

sebastianmacias opened this issue Jan 16, 2018 · 10 comments

Comments

@sebastianmacias
Copy link

What feature are you missing?

Will prisma eventually offer offline-first / browser / server sync similar to gun.js?

This would be very helpful for developing PWAs

@sorenbs
Copy link
Member

sorenbs commented Jan 17, 2018

We are currently waiting for Apollo Client to mature in this area.

Please track this repository https://github.com/apollographql/apollo-cache-asyncstorage/issues/6

@sebastianmacias
Copy link
Author

Excellent, thanks @sorenbs

@marktani
Copy link
Contributor

I'll close this issue, please refer to the mentioned one above.

@schickling
Copy link
Member

I'm reviving this issue to explore more ways how Prisma could make building "offline-first" applications easier. Ideas & use-cases are more than welcome! 🙌

@schickling schickling reopened this May 15, 2018
@sebastianmacias
Copy link
Author

sebastianmacias commented May 22, 2018

Thanks for reopening this @schickling

Here are my thoughts on some offline-first or "similar" libraries I have tested:

Gun.js

Pros:

  • First class offline support, does a great job at syncing data with remote sources
  • Local and remote data can be encrypted

Cons:

  • Limited query engine
  • No support for relationships, join queries nor aggregate queries

Dexie.js

Pros:

Cons:

  • Limited support for relationships and no support of join nor agregate queries

Lovefield

Pros:

  • Amazing performance
  • Excellent query engine, supports relationships, join and aggregate queries
  • Can be used with local sources (IndexedDB) or remote (Firebase) but no other remote adapters are available

Cons:

  • No remote sync, it can use either a local or a remote adapter
  • Even though it's used at Gmail I was recently told by its main maintainer that the project is in maintenance mode and that it is very unlikely that Google will be adding new features (maybe so it doesn't compete with Firebase?)

Nano-SQL

Pros:

  • Great query engine with support for relationships, join queries and offers ways to handle aggregate queries and functions
  • Allows listening to data changes events
  • Multiple adapters for browser and server-side persistence

Cons:

  • No remote sync yet but looks like there is interest and will be implemented

edit: formating

@flybayer
Copy link

Relevant comment on the state of Apollo offline support:
https://github.com/benseitz/apollo-link-offline/issues/1#issuecomment-371678922

@rootedsoftware
Copy link
Contributor

@sorenbs, I'm confused, does the Prisma client use Apollo?

@rootedsoftware
Copy link
Contributor

Ok, nevermind, the "Prisma client" name was confusing. The "client" is a client to the Prisma Server, but it also runs server side. If you want something to run client side (browser, React Native, etc..) then you'll want to use something else (like Apollo Client). prisma/prisma-examples#239 (comment)

@wtrocki
Copy link

wtrocki commented May 16, 2019

@sebastianmacias Thanks for great list of databases. I'm working now on my side project for providing offline support extension to graphql out of the box.

I have created an issue to check if it is possible to use prisma (and I think it should work great with Prisma and some small wrapper package will be required to support conflict resolution).

aerogear/offix#41

Once that is done Prisma community will have a way to work with offline first workflows out of the box.

@wtrocki
Copy link

wtrocki commented May 23, 2019

I have checked and it works. Project will work with any database of our choice, but it will use single key storage for the moment.

We are planning to improve that as part of the https://github.com/apollographql/apollo-cache-persist package.

@janpio janpio closed this as completed Sep 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants