Search code examples
odatasapui5hana

OData calls for fetching large amounts of data and storing them on device


I have a scenario where I need to store large number of records (~20000) on the device for offline usage by user. I wanted some insight on what would be the best way to do that. I am planning on using KAPSEL OData offline plugin to interact with the data.

The major hurdle is the data fetch/store for any user installing the app for the first time. After that only deltas will be fetched and stored periodically. If I make an OData call for 20000 records but I am pretty sure it will result in a timeout or render the UI unusable for a considerable amount of time.

There is always an option of making multiple OData calls with fetching smaller amounts of data each time, or keeping the data files in the app which is not secure.

What could be the best approach for such a scenario?


Solution

  • You could do a first request fetching all the entries just for caching them on the device (Kapsel).

    Later from the UI you should of course use the $top/$skip options to only fetch/render limited chunks of data at once as @lencharest already pointed out.

    Note that some of the SAPUI5 controls can handle this automagically e.g. check sap.m.ListBase growing properties.