Reputation: 361
I am using cassandra as database with a table "jobhistory" partitioned based on timestamp . I have 2 million rows in jobhistory table and it can be increasing over time.
My Implementation: I am purging rows in jobhistory table every 7 days ie setting row level TTL value of 7 Days
Can any one suggest me whether to store in jobhistory table and purge it every 7 days or save it log file using node.js and winston logger and do log rotation , which is the best way to solve this scenario. Please, kindly give the supporting reason as to why it is better .
Any better solutions are also welcome. Any help is appreciated
Upvotes: 1
Views: 382
Reputation: 4957
It will be good if you put TTL while inserting data in cassandra
ie
INSERT INTO kespace.tablename (c1, c2, c3, time) VALUES (2,'Hello','Mary',toTimestamp(now())) USING TTL 30;
Upvotes: 3