How reliable is Firestore as an offline persistence mechanism?

前端 未结 2 1703
后悔当初
后悔当初 2020-12-02 20:41

I am currently using Firebase Firestore as a primary backend that retrieves data from a variety of sources. I also use Android\'s Room for my mobile backend. When the phone

2条回答
  •  春和景丽
    2020-12-02 21:24

    There is no indication in offical documentation on how durable the offline persistence is because it cannot be predicted. This question cannot have an exact answer, like 4 weeks or something like this because it depends on how many write operations take place while you are offline.

    I recommend you not to use Cloud Firestore as an offline-only database. It's really designed as an online realtime database that can work for short to intermediate periods of being disconnected.

    While offline, it will keep queue of all your write operations. As this queue grows, local operations and app startup will slow down. But you need to know that these operation will persist even if you restart the device. You not gonna lose any data.

提交回复
热议问题