Size Limit on Set Item to Storage

Hi,

I’ve been using the 'Set Item to Storage" logic node to save my 20,000+ data (and growing) to my local storage in order to reduce the waiting time when launching the app.

However, the flow works fine when I’m using a small amount of data but fails when I tried to store a large amount of data.

Is there any workaround for this?

Thank you

2 Likes

I dont think that there is a limit for the size you can store other than the memory of the device.
But in general i dont recommend that practice just to save time its best to use on device storage only when you want the data offline, the better solution, is to query and filter in your backend so you only retrieve the data needed each time. that way, you will never have to retrieve that huge amount of records.

1 Like

Hmmm because I’m doing an accounting system, and I the data of all transactions one existence to come out with the balance sheet figure

I can use backend to calculate the aggregate amount, but I’m worried that it will put a significant burden on the backend capacity, that’s why I’m trying to put most of the work on the device

Btw just look at the error message and it is indeed limited by the quota

Error: Failed to execute ‘setItem’ on ‘Storage’: Setting the value of ‘@appgyverApp/338065/default/local-resource:journalStorage:d600d6f8-8af9-47e6-8395-318863a17859’ exceeded the quota.

I mean, such calculations are best to happen in the backend, in general try to avoid so many documents in the app.

as for this, indeed it seams like there are limits, good to know,

@Dimos_Vamvourellis and @Izzuddin_Yussof , some news about?
This problem happen here now!!!

whats your issue exacty?

1 Like

the same problem above descriptive.
The size of my database and the error: “Error: Failed to execute ‘setItem’ on ‘Storage’”.
Do you know if the limite is in SAP Appgyver or in the app? Did you solve it?

@Mevi do you know if it’s a limitation on simulation platform? Nowaday, around 10k lines on storage, an error occur

Like @Dimos_Vamvourellis said, it might be that the device does not have enough memory for the data, or does not allow one app to hog that amount of storage/memory. If setting a smaller amount of data works but 10k lines doesn’t, it’s a memory issue.

Does anyone know how to resolve this?
I’m saving to an On-Device Storage (ODS).
My endpoint returns around 12700 records.
The registration number always changes, now it is saving 623 items on the web and the error appears:

Error: unknown
Error: Failed to execute ‘setItem’ on ‘Storage’: Setting the value of ‘@appgyverApp/548451/default/local-resource:ods_CPT_offline_corrigido:9fc87423-51ad-4cf5-aa6b-24c27986ac87’ exceeded the quota.

On the android smartphone I can’t save anything, the message appears: Error: database or disk is full (code 13 SQLITE_FULL[13])
About smartphone I found this on the internet:
Current Async Storage’s size is set to 6MB. Going over this limit causes database or disk is full error.

I’ve tried to save all the json directly in the ODS as an object, I’ve tried to add it by creating record with loop and the record number varies but an error always appears. Both on the web and on the smartphone an error appears, I have too much storage space on both.

I cleared the cache and data of the Sap Building app on Android and the quota increased, I was able to save 919 records in ODS. Then I decided to uninstall and reinstall the Sap Building app and now it is saving 998 records. I can’t understand why it has this quota.

In the Chrome browser on the computer, I also cleared the cache and saved a maximum of 951 records (I’m using Windows 10 Pro). I also tested it in incognito mode in Chrome and in Mozilla Firefox and reached the quota in just 671 records. The message in Firefox:
Error: unknown
Error: The quota has been exceeded.

A colleague is testing it on the Iphone and there seems to be no limit, up to 7500 records he managed to save in the ODS.

Does anyone know how to solve this quota problem?
I need to know if it will work on Android too.

I need to know this to get involved in a project, the client will only hire me to develop the app if I manage to save all the records to consult offline.

There is a bug report I filed for this issue. Please UPVOTE.

@Mevi, there are different categories of “Persistent Storage”, right? It seems whichever is hardcoded into the SET ITEM TO STORAGE flow function is not adequate for large databases! Please check it out. We greatly appreciate it.

There is an Android solution for React
https://react-native-async-storage.github.io/async-storage/docs/advanced/db_size

Is there a way to do this through appgyver?

1 Like

I don’t believe storage is meant for large amounts of data. Why do you need to store this many records for a longer time on the user’s device? Could you instead store only the most important values / recent values and fetch everything else when app is opened again with a wifi connection?

It’s a customer request, he wants to have the complete database for research when he’s in an area without internet. I don’t understand much about the customer’s business, but I think they often work in rural areas.

On IOS it is possible to store large amounts of data but on Android by default it is limited to 6MB of storage space in SQLite. To change this you need a simple line of code to increase the limit.

I was trying to use firestore now, but I still couldn’t use data persistence.

The customer is interested in subscribing to the paid version of Sap Appgyver. Do you know if you have more offline features in this version?

Note: I’m part of the nocode team, the highcode team has already managed to solve this offline data issue, but the client is giving preference to nocode applications, as they are developed faster, cost less and are easy to maintain