2

I am working on an React Native app (Android-only, no iOS support) that uses Redux with redux-persist to store a bunch of data. It looks like the only well-supported choice for a redux-persist backend is AsyncStorage. https://github.com/rt2zz/redux-persist#storage-engines

The app starts a Foreground Service that needs to read some state persisted by the React Native app. The Foreground Service is implemented in Java and Kotlin and continues running after the user quits the app. The Foreground Service could use the SQLite3 API as described the following posts.

However, the AsyncStorage documentation says "On Android, AsyncStorage will use either RocksDB or SQLite based on what is available" (https://facebook.github.io/react-native/docs/asyncstorage). Is there any way to be sure AsyncStorage will use SQLite3 even if RocksDB is present due to some other app installed on the phone? It would suck to have our app break whenever RocksDB is "available".

Additional links I've looked at:

Joel Sullivan
  • 995
  • 7
  • 11
  • If you are already running native code, why not wrap sqlite and export it with @ReactMethod while you're at it? – basbase Sep 05 '18 at 21:58
  • @basbase I'm hoping to take advantage of the power of `redux-persist` from the React Native side, while using a stabile native JVM API (such as SQLite's API) in my Kotlin code. Just want to make sure this approach won't arbitrarily break if some other app is using RocksDB. – Joel Sullivan Sep 06 '18 at 17:02
  • Any update here? – RaduGabor May 05 '20 at 09:26

0 Answers0