Can we export Firestore cached data from SQLite, and does it will be same like Firestore data bundle?

28 Views Asked by At

I've read from few sources that Firestore uses SQLite as its persistence layer. So I was thought maybe we can export the local data and upload it to a cloud storage?

The objective is to minimize the Firestore read cost by relying data that were cached previously by another devices. At this moment, I am using Firestore bundles, where I had to use a Cloud Function and write some nodejs script to rebuild data bundles on cloud storage periodically. I face difficulty on managing the function where some of the devices might need to read from different collections, so the process on build firestore bundles through cloud function might takes some time. Instead, now I want the client (mobile apps) to do more work.

I think that if I export the cached data that were saved in Device A to the cloud storage, the next users from Device B will load from the cloud storage, and continue the read from where it left. I've found the idea from Github user, but somehow I am not sure how difficult the task can be.

Reference

  1. https://github.com/tejpratap46/FirestoreOfflineFirstAndroid?tab=readme-ov-file#for-example

  2. https://stackoverflow.com/a/62035912/7228432

0

There are 0 best solutions below