I am making an android app similar to WhatsApp. In the app users can send text as well as images. To save the messages so that they can be viewed offline I used :
FirebaseDatabase.getInstance().setPersistenceEnabled(true);
I was wondering how does firebase store messages offline.
Does it create a local database similar to the commonly used sqlite?
The Firebase Realtime Database synchronizes and stores a local copy of the data for active listeners. In addition, you can keep specific locations in sync. The Firebase Realtime Database client automatically downloads the data at these locations and keeps it in sync even if the reference has no active listeners.
Firebase Realtime Database is a NoSQL cloud database that is used to store and sync the data. The data from the database can be synced at a time across all the clients such as android, web as well as IOS. The data in the database is stored in the JSON format and it updates in real-time with every connected client.
Firebase users have a fixed set of basic properties—a unique ID, a primary email address, a name and a photo URL—stored in the project's user database, that can be updated by the user (iOS, Android, web).
The user data for firebase authentication is stored in firebaseLocalStorageDb in IndexedDB .
firebaser here
The disk based local storage of the Firebase Database is a sqlite database that is structured opaquely in a way that your app shouldn't care about. The only way you should access the data is through the Firebase API.
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