Storage in React Native

I'm about to develop offline dictionary app with React Native. But I'm not sure which storage is the best in React Native between SQLite & AsyncStorage. As I read some online documentation and tutorials, when I use SQLite I must need to configure SQLite library in each app iOS and android. And when I look through AsyncStorage not sure it can be handle or not million records inside it. That's why I like to know which one should I use between SQLite & AsyncStorage or some cool library out there for React Native?

For that case, I recommend using Realm. It is simply much faster than AsyncStorage and SQLite. Read this and this for more info.

AsyncStorage has slow runtime and has no indexing capabilities. It accepts only strings as its value and you need to serialize data before inserting and deserialize when reading. So it's not good for large amount of data. It also has 6MB limitation for Android devices.

Comments

Popular posts from this blog

Meaning of `{}` for return expression

Get current scroll position of ScrollView in React Native

React Native - Image Cache