本文介绍了如何在cassandra(使用CQL)中实现固定数量的(timeuuid)列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是一个示例用例:



您需要将基于timeuuid的列中的所有详细信息存储在最后N个(也就是1000个固定桶大小)用户操作。



通常,每个用户的操作都已在UserAction列系列中,其中用户标识为行键,并且timeuuid列中的操作。您还可以具有AllActions列族,其存储具有与列名称相同的timeuuid的所有动作,以及作为列值的用户ID。它基本上是一个关系列的家庭,但不幸的是没有用户操作的任何细节。用这个列族查询很贵,我猜,因为随机partioner。另一方面,如果你在AllActionsCF中存储所有细节,那么cassandra不能在一个点正确处理那个大行。这就是为什么我要存储最后N个用户动作和所有细节在固定数目的timeuuid的列。



也许你可能有一个更好的设计解决方案为这个用例。我想听到...



如果没有,问题是如何有效地实现cassandra(有CQL)的固定数量的(timeuuid) / p>

插入后,我们可以删除旧的(溢出)列,如果我们在cql的DELETE中有一些范围支持。 AFAIK没有支持这个。



那么,任何想法?提前感谢...

解决方案

IMHO,这是C *必须像压缩一样处理自己。在客户端处理这不是一个好主意。



也许,我们需要一些列族的配置(存储)选项,使它们适合最新数据。


Here is an example use case:

You need to store last N (let's say 1000 as fixed bucket size) user actions with all details in timeuuid based columns.

Normally, each users' actions are already in "UserAction" column family where user id as row key, and actions in timeuuid columns. You may also have "AllActions" column family which stores all actions with same timeuuid as column name and user id as column value. It's basically a relationship column family but unfortunately without any details of user actions. Querying with this column family is expensive I guess, because of random partioner. On the other hand, if you store all details in "AllActions" CF then cassandra can't handle that big row properly at one point. This is why I want to store last N user actions with all details in fixed number of timeuuid based columns.

Maybe you may have a better design solution for this use case... I like to hear that ...

If not, the question is how to implement fixed number of (timeuuid) columns in cassandra (with CQL) effectively?

After insertion we could delete old (overflow) columns if we had some sort of range support in cql's DELETE. AFAIK there is no support for this.

So, any idea? Thanks in advance...

解决方案

IMHO, this is something that C* must handle itself like compaction. It's not a good idea to handle this on client side.

Maybe, we need some configuration (storage) options for column families to make them suitable for "most recent data".

这篇关于如何在cassandra(使用CQL)中实现固定数量的(timeuuid)列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 11:12