Hi, I have a table for storing user refresh tokens.
CREATE TABLE IF NOT EXISTS user_refresh_tokens (
refresh_token text,
user_id timeuuid,
PRIMARY KEY (refresh_token)
) WITH compaction = {
'class' : 'TimeWindowCompactionStrategy',
'compaction_window_size' : 1,
'compaction_window_unit' : 'DAYS',
'min_sstable_size' : 52428800 -- 50mb
} AND default_time_to_live = 2592000; -- 30 days
Since access has a lifetime of 5 minutes, each user of the application will read and create a new record in this table every 5 minutes. Since I only need to store them for 30 days, I thought that the window strategy would be a good fit here.
But am I right? How correct is it to have only unique records in such a table?
Maybe it is better to use STCS with the same default_time_to_live
?