了解Firestore定价 [英] Understanding Firestore Pricing

查看:58
本文介绍了了解Firestore定价的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在创建新应用之前,我想确保我获得正确的定价模型.

Before creating a new app I wanna make sure I get the pricing model correct.

例如,在电话簿应用程序中,我有一个名为 userList 的集合,该集合具有作为单个文档的用户列表.

For example in a phonebook app, I have a collection called userList that has a list of users which are individual documents.

我的列表中有5万个用户,这意味着我的收藏集中有5万个文档.

I have 50k users on my list, which means I have 50k documents in my collection.

如果要获取userList集合,它将读取所有50k文档.

If I were to get the userList collection it will read all 50k documents.

FireStore允许 5万次文档读取.这是说总共读取了5万个文档,还是每个文档读取了5万个文档?

FireStore allows 50k document reads. Does that mean 50k document reads in total or 50k document read per document?

就像我的电话簿应用程序示例中一样,如果总共读取5万个文档,我将在一个get呼叫中用完免费限制.

As in the example of my phonebook app if it is 50k document reads in total I will run out of the free limit in just one get call.

推荐答案

如果您实际上必须提取整个5万个文档集合,那么您可能应该问的问题是如何正确构建Firestore数据库.

If you actually have to pull an entire collection of 50k documents, the question you likely should be asking is how to properly structure a Firestore Database.

使用查询 WHERE子句,您很有可能需要根据文档中的某些条件来过滤这些文档.每个客户端设备在本地保存5万个文档,听起来好像数据库规划不佳,而且可能存在安全隐患.

More than likely you need to filter these documents based on some criteria within them by using the query WHERE clause. Having each client device hold 50k documents locally sounds like poor database planning and possibly a security risk.

Each returned document from your query counts as 1 read.如果没有与您的查询匹配的内容,则会收取1读.如果有5万个匹配项,则将收取5万次读取.

Each returned document from your query counts as 1 read. If there are no matches to your query, 1 read is charged. If there are 50k matches, there are 50k reads charged.

例如,您可以检索登录的用户文档,并向1 read收取以下费用:

For example, you can retrieve the logged in user's document and be charged 1 read with something like:

db.collection('userList').where('uid', '==', clientUID)

注意:从2018年10月10日开始,Firestore每天首50k的费用为每10万次读取收取6美分(USD).

Note: As of 10/2018 Firestore charges 6 cents (USD) per 100k reads after the first 50k/ day.

这篇关于了解Firestore定价的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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