【问题标题】:Firestore document max write rate clarificationFirestore 文档最大写入速率说明
【发布时间】:2017-10-29 20:51:17
【问题描述】:

documentation 中,它指出任何单个文档的最大写入速率为 1 写入/秒。 这个限制是浅的还是深的?

例如,假设我有以下结构:

users<collection>/{uid}<doc> : {
  name: "whatever",
  likes<collection>: {
    shard_0<doc>: {
      like_count: 5
    },
    shard_1<doc>: {
      like_count: 4
    },
    ...
    shard_n<doc>: {
      like_count: 4
    }
  }
}

假设我对任何单个分片文档的最大写入速率是 1 写入/2 秒。显然,当我增加类似分片文档的数量时,我永远不会超过其中任何一个的写入限制,但是如果限制很深并且我总结它们,我肯定会超过 {uid 的最大写入速率} 文档。

【问题讨论】:

    标签: firebase google-cloud-firestore


    【解决方案1】:

    只要您的示例中的likes 是一个子集合,您实际上就是在遵循我们为distributed counters in Cloud Firestore 推荐的模式。如果您尝试在单个文档的字段(例如列表)中表示分片,那么由于您确定的原因,这将无法解决。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-10-12
      • 2014-12-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-15
      • 2022-01-25
      相关资源
      最近更新 更多