简体   繁体   中英

What are the cons of using Parse.com's local datastore

The title says it all: What are the cons, the disadvantages and the general bad effects for an iOS app of enabling Parse.com's local datastore?

I'm asking mainly because the local datastore provides a 'side-effect' of creating only one instance of the same (= with the same objectId) object in the memory, which can be, and is, very useful for me in some cases/apps. However, I feel like there might be something bad about enabling the local datastore only for this purpose.

EDIT: Maybe I didn't write it clearly in the first part of the answer. The question is, are there any bad effects, performance hits or other not really nice effects of purely enabling the local datastore in the app, without using any of the methods it provides (ex. -pin)?

Enabling the local datastore but not actually pinning anything should be fine. It's hard to be sure as the implementation is private and it isn't documented what the local datastore is doing if you don't pin.


The local data store is a convenience, nothing more, if it meets your needs (proven by testing) then that is fine and you should use it. The local data store is implemented using JSON files so it isn't the most efficient solution, but if the efficiency doesn't impact you then that's fine. The main benefit is that the interface provided is the same wether you are accessing the network or the local store.

There aren't really any hidden side effects, testing is the key - specifically, testing with sizes of data larger than you expect to really see in production...

The only cons I can think of are:

1) You need to take care of pinning & unpinning. It would not be a hassle, but a few more lines of codes.

2) If you already published some app with server based codes before, and you are trying to have it work with local datastore, migration might require some work. In my case, in the first launch I query all data and pin them so that the data shows up with local datastore.

Hope these are clear.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM