how to implement fixed number of (timeuuid) columns in cassandra (with CQL)?

…衆ロ難τιáo~ 提交于 2019-12-12 16:27:15

问题


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...


回答1:


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".



来源:https://stackoverflow.com/questions/9525579/how-to-implement-fixed-number-of-timeuuid-columns-in-cassandra-with-cql

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!