有关启动新 Cloud Datastore 实体类型以实现快速写入的任何提示吗?

Any tips on priming a new Cloud Datastore entity kind for fast write?

根据 Google Cloud Datastore documentation,快速写入新实体种类是一种不好的做法。它说:

Cloud Datastore prepends the namespace and the kind of the root entity group to the Bigtable row key. You can hit a hotspot if you start to write to a new namespace or kind without gradually ramping up traffic.

如何快速将初始记录集写入命名空间中的事件种类,但种类和命名空间都不是新的?记录数将在5到1000万之间。

例如,假设我有一个命名空间 "ns1" 和一个实体种类 "ek1"。 (在精神上,它对我来说是 "ns1.ek1" 实体。)如果我已经在该命名空间中填充了许多其他实体类型("ns1.ek2"、"ns1.ek3"、...、"ns1.ekX" ),并且我已经在其他命名空间("ns2.ek1"、"ns3,ek1"、... "nsX.ek1")中拥有此类实体,我是否仍会 运行 由于热点而导致性能问题如果我快速写入 "ns1.ek1"?

会更新

我计划通过在私有命名空间中插入大量带有随机键的人工记录来准备一种全新的实体类型,以便快速写入客户特定的命名空间。我想知道这是否是一种有效的技术。

那不行。 Cloud Datastore 按键范围拆分以满足不断增加的负载,命名空间作为键的前缀。

例如,如果您有 ns1.ek1ns2.ek2,并维持对 ns1.ek1 的高负载率,它不会影响拆分以处理 ns2.ek2 的新负载.