Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can FireBase offline mode can be used for localstorage only?

Consider a blogging application which allows offline mode in free version. And once user subscribes for paid version - the data is being synced to firebase.

The question is - since firebase has offline capabilities - can it work (like Parse) that the queries will explicitly use local storage when querying for data? (save/read). So that paid sync can be just a feature flag

Because from what I can tell by skimming the docs, the offline capability seems to be only for "store offline until I'm online" scenarios

Thanks

like image 320
AndroidGecko Avatar asked Apr 19 '16 08:04

AndroidGecko


1 Answers

The Firebase Database is primarily an online database, that continues to work while the user is offline.

While the user is disconnected, Firebase queues the local writes operation in memory (and if you call setPersistenceEnabled(true) to disk). The way this works means that local-only performance will get worse as the local write queue grows.

So unless you have some reasonable maximum to this local number of write operations, your scenario may not work well on Firebase's offline architecture.

like image 142
Frank van Puffelen Avatar answered Oct 10 '22 09:10

Frank van Puffelen