Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If persistence is enabled, what counts as read operations when data exists in cache?

If the listener is disconnected for more than 30 minutes (for example, if the user goes offline), you will be charged for reads as if you had issued a brand-new query.

Does this still apply if persistence is enabled?

Situation 1: App is offline for over 30 minutes. Persistence is enabled and reads data from cache. Does reading documents from cache count as read operations?

Situation 2: App is online but no added/modified/deleted operations occur. Persistence is enabled and all data exists in cache. Does opening my app after 30 minutes cause read operations if no new data has been added/modified/deleted?

Firestore documentation

like image 685
Eric Larson Avatar asked Oct 18 '22 01:10

Eric Larson


1 Answers

In both cases, if some read operation is satisfied only by the local cache, it is not billed.

The issue with the documentation that you quoted about listeners is specifically regarding the total results of a query that could return multiple documents over time. Note that a query listener can generate updates for new or changed documents indefinitely over time. But if your query listener is disconnected for more than 30 minutes, you are billed for the entire query again, and do not pick up where the listener may have left off previously with partial or in-progress results.

like image 166
Doug Stevenson Avatar answered Oct 21 '22 08:10

Doug Stevenson