How to retrieve the whole data from the server

I am making android application that I want to make user use it offline and update when concoction is available
and I don’t want to make user wait every time he opens activity
I am thinking about turning all data after I retrieve it to json for offline time
Right now I made the following

  • Make a base table that have all the data (one-to-many) and have Data_Version (to update only when new data are there)
    Am I taking the right approach or I can do it better?

[center]The Base Table[/center][center]http://i.imgur.com/H40aodi.png?1</img>[/center][center]
[/center][center]child of Base[/center][center]http://i.imgur.com/uwiGvdf.png?1</img>[/center]

Hi Tarekk,

Creating a complete (local) replica of your data for offline storage may not be the best approach. This is for the reason that your online dataset may be rather large AND would be changing over time. Offline/online synchronization is not an easy task. Rather than pulling all the data, you need to decide what the minimum dataset that you need to store locally is and then store just that.

I know this is not a very specific answer, so please follow up with any questions you might have.

Hope this helps.

Regards,
Mark

Does backendless have limit to how much data I can restore ?

I Know that saving all isn’t recommended , but I am trying to save main data value so ,if user ever wanted to lookup thing on app without internet

What do you mean by “restore”?

Sorry for my English
I ment retrieve

No problem. You can retrieve all of your data, but only 100 objects at a time (paging is built in). Here’s an example:
https://backendless.com/feature-17-data-paging-or-how-to-efficiently-load-large-data-sets-in-a-mobile-app/

Regards,
Mark

Thanks Mark

Does you mean 100 items in total (relationships) or 100 items from 1 table

I meant 100 items from 1 table.

Please keep in mind that the backend may restrict loading of deep and complex hierarchies. For example if each of those 100 objects has a one to many relation and each of the related objects has another relation and so on, it will be a very expensive operation on the backend. If we detect that your app does it, the backend will be throttling the amount of data you can load at a time.

The rule of thumb is: do not try to load everything in a single shot. It is a mobile backend and thus supports operations which are typically used in mobile apps. Loading very large collections (depth-wise) is discouraged.

OK thanks Mark
I get it thank you
BTW my data only 2 levels deep and it can be added from the console by me and it is the main data for the application
I am using your back end api for commenting likeing Rating and some sort of posts thing(these data will be treated as the documentation says)

In addition to that the application will retrieve the data(main) only if it has something new

Sounds good, Tarekk. I would love to see the app when it is ready.

Cheers,
Mark

1 Like