Columns and keys can be of any type, since the row key is only the first column. In fact, the cluster is a ring hash ring, and the keys are hashed using a delimiter to distribute it across the cluster.
Beware of using dates as row keys, since even the randomization of the standard randompartitioner is limited, and you can end up cluttering your data.
What else if this date changes, you will have to delete the previous line, since you can only do inserts in C *.
Here is what we know:
- A slice range is a range of columns in a row with an initial value and an end value, which is used mainly for large rows in column order. Known column names defined in CF are indexed, so you can get them by specifying the names.
- A key slice is a key associated with the range of cut columns returned by Cassandra
- The equivalent of the where clause uses secondary indexes, you can use the inequality operators there, but your statement should have at least one equality condition (also see https://issues.apache.org/jira/browse/CASSANDRA-1599 ).
- Using a range of keys is inefficient with Random Partitionner, since the MD5 hash of your key does not support lexical ordering.
What you want to use is a column-based index using the Wide Row: CompositeType (TimeUUID | UserID) To prevent this from getting hot, add the first meaningful key ("shard key") that would divide the data into nodes such as a custom type or region.
Having more data than necessary in Cassandra is not a problem, so it should be designed, so you should ask yourself: โwhat do I need to requestโ and then design a family of columns for it, and not try to fit all in one CF, as in RDBMS.
Gepsens
source share