我可以在 Google Cloud Datastore 中使用的命名空间数量是否有限制?

Is there a limit to the number of namespaces I can use in Google Cloud Datastore?

我猜答案是否定的,因为文档中没有指定限制,但我有点困惑,因为命名空间选择在 Google 云控制台中显示为下拉列表,这意味着名称空间不应超过下拉菜单所能容纳的数量。

基本上我想知道如果我为我拥有的每个用户创建一个命名空间并且我有十亿个用户,那么拥有十亿个命名空间是可以的。

Each entity in the Datastore has a key that uniquely identifies it. The key consists of the following components:

  • The namespace of the entity, which allows for multitenancy
  • The kind of the entity, which categorizes it for the purpose of Datastore queries
  • An identifier for the individual entity, which can be either

由于命名空间只是键(前缀)的一部分,所以对于Cloud Datastore来说,命名空间的最大数量是绝对没有限制的。

此外,在每个用户或每个客户端的基础上创建名称空间通常是名称空间的典型应用。您可以在 App Engine documentation.

中找到更多详细信息

您可以根据需要拥有多个命名空间,但在某些时候某些功能也会停止工作。例如,数据存储自动生成的统计信息将停止生成名称空间级别的统计信息(例如,特定名称空间中的实体数量)。