The documentation says it should be used instead of LocalStorage, but it doesn't list anything regarding how large it is. If I recall, LocalStorage in web browsers is only about 10mb.
https://facebook.github.io/react-native/docs/asyncstorage.html
Motivation Current Async Storage's size is set to 6MB. Going over this limit causes database or disk is full error. This 6MB limit is a sane limit to protect the user from the app storing too much data in the database.
Note that on Android AsyncStorage has an upper size limit of 6MB.
AsyncStorage is an unencrypted, asynchronous, persistent, key-value storage system that is global to the app. It should be used instead of LocalStorage. It is recommended that you use an abstraction on top of AsyncStorage instead of AsyncStorage directly for anything more than light usage since it operates globally.
AsyncStorage takes about 12x more time to read/write on average compared to localStorage. This article introduces a few techniques to optimize AsyncStorage so that it could be improved such that it could be used in production.
It writes to disk and is very large if there is free space. On iOS there are no artificial caps other than what the underlying operating system imposes: https://stackoverflow.com/a/1897383/454967.
The new way of increasing AsyncStorage size on react-native is to add AsyncStorage_db_size_in_MB=
property to your android/gradle.properties
as shown here: https://react-native-async-storage.github.io/async-storage/docs/advanced/db_size/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With