1

Cloud Firestore supports offline persistence, even for web applications: https://firebase.google.com/docs/firestore/manage-data/enable-offline

It seems to me that this feature is not available in the real-time database. I couldn't find anything related in the docs.

Does the real-time database have persistence?

Please note that this concerns the web version of the real-time database. I know that offline persistence and caching is a key feature for the Android SDK etc. If you look at the docs for enabling offline capabilities for Android and web, they are very different. For Android, you can find instructions on disk persistence. For the web, you only get information on connection/disconnection events.

Shrawan
  • 95
  • 2
  • 7
lhk
  • 27,458
  • 30
  • 122
  • 201
  • See https://stackoverflow.com/questions/32530190/does-firebase-javascript-api-catch-up-with-server-when-re-connected/32530269#32530269 (TL;DR: no) – Daniel Beck Jan 28 '19 at 12:05
  • @DanielBeck, thanks for the link. I flagged this as a duplicate. Do you know the correct procedure, should I just delete the question ? It might be useful to keep this one up, with the link to the answer, I think that this title is more descriptive – lhk Jan 28 '19 at 12:14
  • Duplicates are still useful, don't delete this one. I considered this a borderline case anyway -- the questions aren't quite the same, though the answer I linked to works for both -- which is why I wimped out and just linked to it instead of marking as dupe.... but marking it is also fine; it'll go in the review queue and the collective hive mind will make its judgement :) – Daniel Beck Jan 28 '19 at 12:17
  • @DanielBeck the system is rather neat. After marking it as duplicate, it offers me a checkbox "yes that answered my question". So it is now officially a duplicate :P – lhk Jan 28 '19 at 13:52
  • Heh, there you go. I've never had occasion to mark my own question as a duplicate so didn't know that was part of the system. – Daniel Beck Jan 28 '19 at 14:28

1 Answers1

0

Yes. If you read the documentation you will see that it is supported. It is even in the ultra short explanation of what RTDB is:

https://firebase.google.com/docs/database/

And in the key_capabilities:

https://firebase.google.com/docs/database/#key_capabilities

iCediCe
  • 1,672
  • 1
  • 15
  • 32
  • hm, I'm not so sure about this. The persistence is advertised a lot, but I just couldn't find anything in the docs (for web!). For android you get precise instructions, for the web this information is simply not there. They don't explicitly say that the web version has no caching, but it does look like it. Updated my question to emphasize more that this is about the WEB sdk – lhk Jan 28 '19 at 11:54
  • Hmm your right. I missed the fact that you were talking JS only... I seems that only very basic offline state is possible... https://firebase.google.com/docs/database/web/offline-capabilities – iCediCe Jan 29 '19 at 14:34