【问题标题】:Cassandra : The maximum size of an item in a collection is 64KCassandra:集合中项目的最大大小为 64K
【发布时间】:2015-01-29 13:14:20
【问题描述】:

如果收集数据超过 64K,是否有替代方案。

根据cassandra doc

Observe the following limitations of collections:

The maximum size of an item in a collection is 64K.
Keep collections small to prevent delays during querying because Cassandra reads a collection in its entirety. The collection is not paged internally.

As discussed earlier, collections are designed to store only a small amount of data.
Never insert more than 64K items in a collection.

If you insert more than 64K items into a collection, only 64K of them will be queryable, resulting in data loss.

【问题讨论】:

  • 您要找多大的?他们似乎建议将单元格值保持在

标签: cassandra cassandra-2.0 cql3 cqlsh cassandra-cli


【解决方案1】:

在您的情况下,我建议您不要使用 C* 集合。请改用分区键集群列的组合。所以你没有 64K 的限制。

链接:http://www.datastax.com/documentation/cql/3.0/cql/ddl/ddl_compound_keys_c.html

【讨论】:

  • 如果用户有不同的组。例如,user1 有学生、老师、朋友等等…​​…而 user2 有学生、朋友和同事。在这种情况下,学生和朋友比我们维护的方式重复..
  • 我认为您在使用 C* 集合时也会遇到同样的问题,但没关系。您不应该尝试像在关系数据库中那样对数据进行非规范化。
猜你喜欢
  • 2011-03-09
  • 1970-01-01
  • 1970-01-01
  • 2018-08-04
  • 2011-08-07
  • 2012-04-19
  • 1970-01-01
  • 2017-09-09
  • 2013-10-09
相关资源
最近更新 更多