So I am storing user events in Cassandra and am looking for the right key'ing for the table.
CREATE TABLE user_events (
user text,
timestamp timestamp,
ip text,
event text,
content text,
service text,
PRIMARY KEY (user, timestamp)
) WITH CLUSTERING ORDER BY (timestamp DESC)
AND compaction = { 'class' : 'DateTieredCompactionStrategy' };
I know there is a limit to a single partition ( I think ~1B ). I do not plan on deleting data as it gets older. Would I need to also key this by month or something? eg:
PRIMARY KEY((user, month) timestamp)
Or if there is a more optimal way or storing events for time-series data.