Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AsyncStorage vs Expo.SQLite

i am working on creating and app that will download, upload, store many images. i am trying to see how best to manage the data for performance.

i am using Redux to store the state of my app and i use redux-persist to store the state in AsyncStorage.

but i also understand that create-react-native-app also provides a module called SQLite in the expo package. (https://docs.expo.io/versions/latest/sdk/sqlite.html).

i am trying to find out where it would be a good idea to store my data.

should i store all my images (base64 encoded) into redux? this could amount to up to 100mb of data. or should i store the images into SQLite where i assume the data is stored flat like in an sqlite “.db” file?

like image 887
X0r0N Avatar asked Nov 18 '22 21:11

X0r0N


1 Answers

I would store the images to the filesystem using FileSystem.downloadAsync. Then you can store the mapping from unique ID to image filepath in SQLite or Redux + AsyncStorage.

like image 74
tom Avatar answered Dec 15 '22 17:12

tom