redux-persist-sqlite-storage
redux-persist-sqlite-storage copied to clipboard
Timeout error during Rehydration when data size is large
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
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
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...