Cloud Firestore付款

编程入门 行业动态 更新时间:2024-10-28 10:28:45
本文介绍了Cloud Firestore付款的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

与实时数据库相比,我对Cloud Firestore的付款有疑问.在Firestore中,您需要为每个文档支付读/写费用,对吗?换句话说:如果我在一个集合中显示1000个文档的列表,我是否需要为1000次阅读付费?

I have a question regarding payment at the Cloud Firestore compared to the Realtime Database. At Firestore you pay per read/write per document, right? In other words: If I display a list of 1000 documents in a collection, do I pay for 1000 reads?

我的应用程序中有一些集合,其中包含许多(200-300)个文档,不幸的是,所有这些文档都必须显示在一页上.我的应用程序有大约10,000个活动用户.经过计算,我肯定在财务上陷入困境...:-)

I have a few collections in my app with many (200-300) documents, which unfortunately all have to be displayed on one page. My app has about 10,000 active users. After the calculation I am definitely financially broke... :-)

因此,我的问题是:如果将300个元素保存在一个文档中作为数组并检索它们,是否也考虑了300个元素和300个读取?那么,是否仅将一个文档计算为阅读?还是创建的数组中的300个元素?

Therefore my question: Are 300 elements also 300 reads taken into account if I save the 300 elements in ONE document as an Array and retrieve them? Is then only the one document calculated as a read? Or also the 300 elements from the created array?

推荐答案

如果我在一个集合中显示1000个文档的列表,我是否需要为1000次读取付费?

If I display a list of 1000 documents in a collection, do I pay for 1000 reads?

您只需支付在服务器上读取或从服务器读取的文档的费用.大多数Firestore SDK都实现了客户端缓存,这可能会大大减少在服务器上读取/从服务器读取的文档数量.

You only pay for documents that are read on/from the server. Most Firestore SDKs implement a client-side cache, which may significantly reduce the number of documents that are read on/from the server.

我的应用程序中有一些馆藏,其中包含许多(200-300)个文档,不幸的是,所有这些文档都必须显示在一页上

I have a few collections in my app with many (200-300) documents, which unfortunately all have to be displayed on one page

减少读取操作次数的一种方法是将一页的数据建模到单独的单个文档中.该文档本质上是应用程序中单个页面的数据,这意味着您在任何基础数据更新时都会对其进行更新.当您向数据库写入更新时,这会导致更多代码,但为每个访问该页面的用户节省299个文档读取次数.

One way to reduce the number of read operations is to model the data for that one page into a separate single document. This document is essentially the data for a single page in your app, meaning that you update it whenever any of the underlying data updates. That leads to more code when you write updates to the database, but it saves you 299 document reads for every user accessing the page.

另请参阅:

  • Cloud Firestore定价|了解Cloud Firestore#3
  • Firestore:如何读取"数据?计算配额?
  • 用于查询的Firebase Firestore定价
  • 了解Firestore定价

更多推荐

Cloud Firestore付款

本文发布于:2023-11-22 05:13:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1616102.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Cloud   Firestore

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!