简体   繁体   English

Cassandra 表有多少个分区键?

[英]how many partition key for a Cassandra table?

partition key for a Cassandra table? Cassandra 表的分区键?

In customer table customerid is partition key?在客户表中 customerid 是分区键吗?

Suppose I have 1 million customers in year so I have 1 million partitions假设我一年有 100 万客户,所以我有 100 万个分区

After 10 years so I have 10 million customers or more also ... so I have 10 million paritions 10 年后,我有 1000 万名客户或更多……所以我有 1000 万个分区

SO my Question is ?所以我的问题是? 1) if I want read customers table (10 million partition) is that affect the read performance ? 1)如果我要读取客户表(1000万分区)是否会影响读取性能?

note : In single partition we may have 50 to 100 columns ?注意:在单个分区中,我们可能有 50 到 100 列?

You have the right idea in that you'll want to use data modeling to create a multi-tenant environment.您的想法是正确的,因为您希望使用数据建模来创建多租户环境。 The caveat is that you're not going to want to do full table/multiple partition scans in Cassandra to retrieve that data.需要注意的是,您不想在 Cassandra 中进行全表/多分区扫描来检索该数据。 It's pretty well documented as to why, but anytime you have a highly distributed environment, you will want to minimize the amount of network hops, data shuffling, etc. Can't fight physics :)关于原因,它有很好的文档记录,但是无论何时您拥有高度分布式的环境,您都会希望最大限度地减少网络跃点、数据改组等的数量。无法对抗物理:)

Anyways, it sounds like this is reporting type of use case - you're going to need to use something like Spark or some type of map and reduce to efficiently report on multiple partitions like this.无论如何,这听起来像是报告类型的用例 - 您将需要使用类似 Spark 或某种类型的地图并减少来有效地报告这样的多个分区。

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

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