I’m new to RN/Expo & I can’t figure out db/storage really. Basically, I want to make an offline travel guide app which will contain text & images that will need internet only for maps. And I want to enter its data through a desktop web CRUD API that I’ll write. So what is the best database/storage option for this kind of purpose?
I’d look at
AsyncStorage (https://docs.expo.io/versions/latest/react-native/asyncstorage/) to see if it meets your needs before you look at something more complex, like
SqlLite. Where the data is coming from doesn’t really matter in terms of the API you use in the app- you’ll download your data over HTTP with
fetch and then save the object using
For storing images, you’ll likely want to use
FileSystem (https://docs.expo.io/versions/latest/sdk/filesystem/), particularly
downloadAsync() to download a file over HTTP directly to the filesystem.
One thing to keep in mind if you haven’t yet written the web CRUD API is that you could possibly take advantage of an end-to-end solution like Firebase. Firebase would provide a URL for you to store data, and then your app could subscribe to that URL using Firebase’s client-side API, download the data, and also automatically cache it for offline use with no further effort on your part. There’s certainly a learning curve there, and you’d have to eject your app, but it works quite well once it’s up and running.
Thanks a lot for your reply, it was very helpful.
This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.