Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Realtime Database maximum cache size in Android

What is the maximum Firebase Realtime Database cache size for an Android client? Is it limited by Firebase or Android?

Firebase documentation says:

By default, 10MB of previously synced data will be cached. This should be enough for most applications. If the cache outgrows its configured size, the Firebase Realtime Database will purge data that has been used least recently. Data that is kept in sync, will not be purged from the cache

But the final sentence there (with it's oddly placed comma) makes the paragraph unclear to me. Is there a 10MB limit?

like image 813
aez Avatar asked Jun 19 '26 15:06

aez


1 Answers

The limit of 10MB is one that comes from the Firebase SDK.

The last lines refers to data from locations on which you've called ref.keepSynced(true). These locations will not be evicted from the cache.

The write queue (any local write operations that are not yet synchronized with the server) is not part of the 10MB limit.

So it is possible that the persistent cache may require a bit more than 10MB. In general that should be limited though.

like image 51
Frank van Puffelen Avatar answered Jun 22 '26 03:06

Frank van Puffelen