简体   繁体   English

Cloud Firestore交易的限制

[英]Limitations on Cloud Firestore transactions

I have read the docs regarding transactional update operations on Firestore . 我已经阅读了有关Firestore上的事务更新操作的文档。 According to Quotas and Limits there are only two limits with regards to transactions: 根据配额和限制,关于交易只有两个限制:

  • Maximum size for a transaction: 10 MiB 交易的最大大小:10 MiB
  • Time limit for a transaction: 270 seconds, with a 60-second idle expiration time 事务的时间限制:270秒,空闲时间为60秒

There is no explicitly transaction-related limit mentioned, how many documents or collections can be read and/or modified during the transaction, or if there are any additional constraints on the collections in which the transactional updates happen. 没有提到明确的与事务相关的限制,在事务期间可以读取和/或修改多少文档或集合,或者在发生事务更新的集合上是否存在任何其他约束。

  1. Does it mean, a client could do a transactional update on up to 500 documents, each in different collections, as long as the update stays inside these and the other general limits? 这是否意味着,只要更新不超出这些限制和其他一般限制,客户就可以对多达500个文档进行事务更新,每个文档位于不同的集合中?

  2. If a client reads multiple documents inside a transaction, but only updates one of them - does Firestore still (silently) write into the unmodified documents (for serialization or so)... so I have to consider the write-limit of 1 write per document per second even for documents that have not been explicitly modified by the client. 如果客户在一个事务中读取多个文档,但仅更新其中一个文档-Firestore是否仍(默默地)将未修改的文档写入(用于序列化等)...所以我必须考虑每个实例的写入限制为1个每秒文档数,即使对于客户端未明确修改的文档也是如此。

PS: The reason I ask is that Datastore has a limit of 25 entity-groups in transactions, and also sees hotspots in entities ("documents") that are read-only inside many write transactions. PS:我问的原因是数据存储区在事务中有25个实体组的限制,并且还会看到许多写事务中只读的实体(“文档”)中的热点。 For example, see this answer by Dan McGrath . 例如,请参见Dan McGrath的答案 I just wonder which of Datastore's characteristics carry over to Firestore and has to be considered when designing a Firestore database. 我只是想知道Datastore的哪些特性会延续到Firestore中,并且在设计Firestore数据库时必须考虑这些特性。

See the line "Maximum number of documents that can be passed to a Commit operation" which defines a limit of 500 documents. 请参阅“可以传递给Commit操作的最大文档数”行,该行定义了500个文档的限制。 This is your transaction limit as we need to apply everything in a transaction using a single commit. 这是您的交易限额,因为我们需要使用一次提交来应用交易中的所有内容。

I don't believe silent writes are required anymore to determine if a document has changed in a transaction. 我认为不再需要静默写入来确定文档在事务中是否已更改。

There is no related limit that is equivalent to the 25 entity-group limit. 没有等于25个实体组限制的相关限制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM