BigTable:将 ID 存储为限定符?
BigTable: Storing IDs as Qualifiers?
在 GCP 文档上说:
Because Cloud Bigtable tables are sparse, you can create as many column qualifiers as you need in each row. There is no space penalty for empty cells in a row. As a result, it often makes sense to treat column qualifiers as data. For example, if your table is storing user posts, you could use the unique identifier for each post as the column qualifier.
https://cloud.google.com/bigtable/docs/schema-design#column_families
谁能帮我举个例子?
如果我有 100 万用户并且每个用户发布 1000 个帖子,那么使用 1B 列限定符 (1M * 1000) 是否有意义?
谢谢!
这里有几个相关的限制条件:
- 每行 256 MB 的硬性限制
- 一行不能跨不同的节点拆分,这会阻止并行化
因此,您可能希望避免将来自多个用户的数据存储在一行中。所以你不会在一行中有 1B 个帖子。但是,有 1M 行,每行有 1000 个限定符应该没问题。您可以将列限定符视为哈希图中的键。
与 SQL 或列族不同,每行中的限定符与不同行中的限定符完全无关。
在 GCP 文档上说:
Because Cloud Bigtable tables are sparse, you can create as many column qualifiers as you need in each row. There is no space penalty for empty cells in a row. As a result, it often makes sense to treat column qualifiers as data. For example, if your table is storing user posts, you could use the unique identifier for each post as the column qualifier.
https://cloud.google.com/bigtable/docs/schema-design#column_families
谁能帮我举个例子? 如果我有 100 万用户并且每个用户发布 1000 个帖子,那么使用 1B 列限定符 (1M * 1000) 是否有意义?
谢谢!
这里有几个相关的限制条件:
- 每行 256 MB 的硬性限制
- 一行不能跨不同的节点拆分,这会阻止并行化
因此,您可能希望避免将来自多个用户的数据存储在一行中。所以你不会在一行中有 1B 个帖子。但是,有 1M 行,每行有 1000 个限定符应该没问题。您可以将列限定符视为哈希图中的键。 与 SQL 或列族不同,每行中的限定符与不同行中的限定符完全无关。