0

We are considering migrating our Android data to Firestore. We have a mostly read-only database (Users will only ever read, but staff will push updates a couple of times daily). For now we are not considering Firebase Storage.

The biggest issue for us is that with the database being fairly large and us targeting markets with poor data contracts - we don't wan't everybody to fetch the full database on first launch (I'm aware you can do partial requests, but the full data would be required)

We wanted to solve this by bundling a default database with each release (we currently do this), the device would then sync with Firestore and download the newer mutations.

Is this possible at all? We are hoping to connect the Firestore objects with either bundled copies of the documents or with a serialized snapshot?

The aim here is that the snapshot would be seen by the Firestore SDK as the full set of documents - Exactly as if you had ran the query on the device a couple of hours earlier and kept the listener. So the listener would be receiving the delta.

Nick Cardoso
  • 20,807
  • 14
  • 73
  • 124
  • 1
    "The device would then sync with Firestore and download the newer mutations." Unfortunately, you cannot do this in Firestore. Please see my answer from this **[post](https://stackoverflow.com/questions/53156109/how-to-skip-initial-data-and-trigger-only-new-updates-in-firestore-firebase/53156370#53156370)**. All initial data is required. – Alex Mamo Nov 09 '18 at 08:56
  • You haven't understood before down voting. The aim here is that the snapshot would be seen by the Firestore SDK as the full set of documents - Exactly as if you had ran the query on the device a couple of hours earlier and kept the listener. So the listener would be receiving the delta. The other question there seems to be a misunderstanding about snapshot caching of a repeat request – Nick Cardoso Nov 09 '18 at 09:11

1 Answers1

1

Firestore doesn't provide a way to bundle into your app some default data that can be queried with the SDK. Firebase is a cloud-hosted database, which means that all data must live "in the cloud" in order to be queried (or must have been previously queried and cached locally, which can be read while offline).

You are always free to file a feature request, however.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441