Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any plans to add Local Datastore for JS SDK? #77

Closed
h4rm opened this issue Nov 2, 2015 · 33 comments
Closed

Any plans to add Local Datastore for JS SDK? #77

h4rm opened this issue Nov 2, 2015 · 33 comments
Labels
type:feature New feature or improvement of existing feature

Comments

@h4rm
Copy link

h4rm commented Nov 2, 2015

Are there any plans to add the local datastore to the Javascript SDK just like it happened in the Android/iOS SDK?

While I can save object.toJSON() to the localStorage, the JSON serialization does not recursively save all the other objects that were included in the query but renders out pointers instead.

@andrewimm
Copy link
Contributor

We're actively exploring methods of local storage, so that apps built on platforms like React Native can perform queries when offline. The biggest questions at this point are around how the storage would be interfaced, and whether it would live in the SDK or an addon. For interfaces, the current frontrunner is a Flux-like store based on the one from Parse+React, which fits well in to the new SDK's internal storage scheme. As for where it lives -- the new Controller-based architecture of the SDK makes it really easy to replace individual pieces, and provide functionality as external libraries that are loaded at runtime.

@reidmweber
Copy link

👍 We have an iOS app that uses parse and the local datastore. We would like to use parse for a desktop app written with Electron. Ideally, we could use the same methods (pinInBackground, .fromLocalDatastore, etc). Would that work if it was an add-on?

@wookiem
Copy link

wookiem commented Jan 12, 2016

Any update on availability of a local datastore for React Native?

Also, are you working on any strategies to make query subscriptions more React-like? Unless I'm mistaken, the only way to refresh on-screen data is to re-query the datastore periodically, without any knowledge of whether the underlying data has changed. Thanks!

@carbureted
Copy link

+1 on any update regarding a React Native local datastore. Trying to choose between hacking something together on SQLite or integrating parse with the hope that storage is eventually figured out.

Even a negative timeframe like "Not in the next 3 months" would be super helpful.

@yamill
Copy link

yamill commented Jan 27, 2016

+1 I think this is much needed - especially for React Native apps.

@5amfung
Copy link

5amfung commented Feb 9, 2016

Agreed with @carbureted. If local storage is not the priority, please let us know so that we could make a sound decision of what to do.

@andrewimm
Copy link
Contributor

It's not a priority at the moment, because it would take some significant restructuring to provide any valuable querying over local objects. If we were to implement a LocalDatastore similar to the one seen on Android / iOS, it would probably be a redesign version that avoids some of the less performant aspects of pinning. Any API we would implement would also want to be something that works the same way on both React Native and and offline ServiceWorker web apps, so there's a lot of thinking to do here before any action is taken.

@ssssssssssss
Copy link

Any progress here? Shall we just need to wrap the native SDKs to achieve this?

@wookiem
Copy link

wookiem commented Jul 27, 2016

Hi @carbureted. If you happen to use Redux for local storage, you can take
advantage of redux-persist for seamless local storage.

On Wed, Jul 27, 2016 at 3:40 AM, fxwan [email protected] wrote:

Any progress here? Shall we just need to wrap the native SDKs to achieve
this?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#77 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AG758JjQH0XBGYsq6OpFrn6b13MNHnB-ks5qZwt0gaJpZM4GaGRU
.

@jbeckton
Copy link

jbeckton commented Aug 6, 2016

Since my mobile apps will be written in javascript this is the one feature that is pushing me towards Firebase. Offline support for javascript mobile apps is supported with the Firebase js sdk. It would be great if the Parse Platform team would put a higher priority on this feature as I would rather go with Parse.

@minikin
Copy link

minikin commented Aug 29, 2016

I guess it will be also an awesome option for IoT projects.

@cleever
Copy link

cleever commented Oct 13, 2016

Any news on this?

@jonas-db
Copy link

Thie feature is still missing.

@joshuadiezmo
Copy link

I'll wait for this.

@jbeckton
Copy link

jbeckton commented May 2, 2017

PouchDB can be used on the device for off line storage, one can find a creative way to pull data entered during offline and pass it to the parse SDK to be sent to the server.

@jcguarinpenaranda
Copy link
Contributor

Any news on this ?

@felipap
Copy link

felipap commented Jan 26, 2018

Bumping.

@brancooo1
Copy link

+1 making offline store for React Native

@Tyg-g
Copy link

Tyg-g commented Jul 4, 2018

+1 I'd also welcome this feature

@heresmyinfo
Copy link

+1 WAY important

@flovilmart
Copy link
Contributor

As many people request this feature, we can offer guidance on the implementation. We are strapped as the core maintainers have their cup pretty full with all the projects and the ongoing work on other repositories. If anyone / many want to get on it, feel free to reach out!

@jamlfy
Copy link

jamlfy commented Jul 10, 2018

Is the frist step.. to create PWA! And say "only in Android/iOS", is not a solution.

@dplewis
Copy link
Member

dplewis commented Jul 25, 2018

I'm currently using ionic and it supports sqlite for querying which is similar to iOS SDK. If react-native also supports offline, redux, could we create an adapter / interface to support scaling.

I'm familiar with SQL so I'm willing to create an adapter for it.

@cleever
Copy link

cleever commented Jul 25, 2018

I think it should be framework agnostic. Parse-SDK-JS works fine with React, Angular/Ionic, Vue or any framework you like. Local Datastore should not be tied with one framework or something like that.

@flovilmart
Copy link
Contributor

Agreed with @cleever. Also, what offline features do we want exactly?

@dplewis
Copy link
Member

dplewis commented Jul 25, 2018

@flovilmart I use the iOS local datastore a lot so. But i need something simple like pin an object and query it back is a good start.

Also would we implement it similar to what you did with the react-native async storage issue? I'm trying to see the best way to implement this.

@flovilmart
Copy link
Contributor

flovilmart commented Jul 25, 2018

I believe we can leverage the same provided local datastore. JS / web datastore i believe settled on key/value stores no? Pin and queries can live with this, without requiring complex SQL. I you look at the implementation on iOS, you’d see the objects are stored as blobs, indexed in a single table, having the className /id as primary key.

So having a good key value store implementation at first could be good. As object structures are not known, this will come at a perf cost, but, I guess it’s acceptable.

Still curious of what we should implement first ;)

@dplewis
Copy link
Member

dplewis commented Jul 25, 2018

So having a good key value store implementation at first could be good.

Key / Value is more widely used if you are going framework agnostic.

What do you think the Key / Value should be?

@dplewis
Copy link
Member

dplewis commented Jul 26, 2018

I you look at the implementation on iOS, you’d see the objects are stored as blobs, indexed in a single table, having the className /id as primary key.

Just looked at iOS. But iOS uses simple SQL queries.

screen shot 2018-07-25 at 7 02 21 pm

I can start a PR for pinWithName and fromPinWithName as a start and we can build from there.

Default can use localStorage

@flovilmart
Copy link
Contributor

Yeah, that makes for simple queries, which are easier to implement in a key/value manner. I haven’t dug very deep in all the mechanics but the iOS SDK also loads the objects from memory / datastore when created by id without data, also keeping the single instance in memory per objectId

@dplewis
Copy link
Member

dplewis commented Jul 26, 2018

I don’t understand it all either lol. I wish localStorage at least was like redis where it you can use * with keys.

Edit: There might be a workaround. You can get all keys from localStorage and do a match or would in memory be better?

@dplewis
Copy link
Member

dplewis commented Jul 27, 2018

I started on a PR #612 if you want to move the discussion there.

@dplewis
Copy link
Member

dplewis commented Jan 10, 2019

Closing via #612

@dplewis dplewis closed this as completed Jan 10, 2019
@mtrezza mtrezza added type:feature New feature or improvement of existing feature and removed type:improvement labels Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

No branches or pull requests