简体   繁体   中英

Is it okay to store a lot of data with Async Storage? [React Native]

I'm working on a react native app where I have my firebase database storing an inventory of about 10000 items. So I need to store that data locally and I was thinking of saving each item into his own key with async storage. Is that okay or is there a more efficient way?

AsyncStorage has slow runtime and has no indexing capabilities. Because AsyncStorage only accepts string as its value, all data must first be serialized into string before being inserted, and deserialized once retrieved. This is why you should not use AsyncStorage when dealing with a large amount of data

you can read this article for more information on how AsyncStorage works while dealing with large data: https://codeburst.io/tackling-react-native-storage-part-1-d27b2bfa480f

You can use AsyncStorage, it will always take a time when you try to retrieve the data from it.

There are other possible way like:

1) React Native SQLite 2

2) React Native Storage

3) Realm

4) React Native Local MongoDB

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM