redux-persist-sqlite-storage icon indicating copy to clipboard operation
redux-persist-sqlite-storage copied to clipboard

Timeout error during Rehydration when data size is large

Open akashsharma88 opened this issue 5 years ago • 2 comments

I use this library with redux-offline (which uses redux-persist v4 by default) to make an offline first app . I got ~100k records(~50MB) via REST API to store .but I can only store about 30k -40k (~25MB) and i get OutOfMemory error. so i reduce my data to 30k which comes from REST api , finally i can store 30k records but when my app open next time ,during rehydration I get timeout error and all records are vanished and my app gets to its initial state with 0 records. so my problem is how to rehydrate without timeout error. I tried to increase timeout in store config to timeout:30000 but not work here is my store config

import SQLiteStorage from 'redux-persist-sqlite-storage'; import SQLite from 'react-native-sqlite-storage'; ... other imports

const storeEngine = SQLiteStorage(SQLite, defaultConfig);

const persistConfig = { timeout: 30000, key: 'persist', storage: storeEngine, blacklist: ['Reducer0'], whitelist: ['Reducer1', 'Reducer2'] }; ...rest of code

akashsharma88 avatar Jan 23 '20 07:01 akashsharma88

Have you got to any conclusion?

Having the same issue, where I am trying solutions like watermelon and Realm, but no success until now. Integrating those "db" are hard with redux

felipegs31 avatar Sep 18 '20 15:09 felipegs31

I'm wondering if could be possible to use the library without the "Rehydration" process, so the data would stay on "cold file" / SQLite until it's needed on memory. I think this would be the perfect word for redux-persist.

Because at the moment does not matter where you store the data (SQLite/AsyncStorage/FileSystem), when the rehydration occurs, everything goes to memory...

williamgurzoni avatar Mar 09 '21 02:03 williamgurzoni