prisma / prisma1

💾 Database Tools incl. ORM, Migrations and Admin UI (Postgres, MySQL & MongoDB) [deprecated]
https://v1.prisma.io/docs/
Apache License 2.0
16.55k stars 863 forks source link

Offline-first support #1659

Closed sebastianmacias closed 2 years ago

sebastianmacias commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

Excellent, thanks @sorenbs

marktani commented 6 years ago

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

schickling commented 6 years ago

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! 🙌

sebastianmacias commented 6 years ago

Thanks for reopening this @schickling

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

Gun.js

Pros:

Cons:

Dexie.js

Pros:

Cons:

Lovefield

Pros:

Cons:

Nano-SQL

Pros:

Cons:

edit: formating

flybayer commented 6 years ago

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

rootedsoftware commented 5 years ago

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

rootedsoftware commented 5 years ago

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). https://github.com/prisma/prisma-examples/issues/239#issuecomment-442459867

wtrocki commented 5 years ago

@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).

https://github.com/graphql-heroes/offix/issues/41

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

wtrocki commented 5 years ago

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.