Cloud Firestore付款 [英] Cloud Firestore Payments

查看:50
本文介绍了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付款的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆