Just to speak up here, I think it's a more common use-case than you're imagining, eve if maybe there's no reasonable way of implementing it.
I for one have plenty of use for a TTL on a key, though in my case the TTL would be in days/weeks. Alternatively, I know it's considered "wrong", but having a way of getting all unique keys + timestamps from a RandomPartitioner would allow me to do manual scavenging of my own. sstable2json is perhaps not appropriate because it includes replicated data. On Tue, Jan 12, 2010 at 11:56 AM, Jonathan Ellis <jbel...@gmail.com> wrote: > I'm skeptical that this is a common use-case... If truncating old > sstables entirely > (https://issues.apache.org/jira/browse/CASSANDRA-531) meets your > needs, that is going to be less work and more performant. > > -Jonathan > > On Tue, Jan 12, 2010 at 10:45 AM, Sylvain Lebresne <sylv...@yakaz.com> > wrote: > > Hello, > > > > I have to deal with a lot of different data and Cassandra seems to be a > good > > fit for my needs so far. However, some of this data is volatile by nature > and > > for those, I would need to set something akin to a TTL. Those TTL could > be > > long, but keeping those data forever would be useless. > > > > I could deal with that by hand, writing some daemon that run regularly > and > > remove what should be removed. However this is not particularly > efficient, nor > > convenient, and I would find it really cool to be able to provide a TTL > when > > inserting something and don't have to care more than that. > > > > Which leads me to my question: why Cassandra doesn't allow to set a TTL > for > > data ? Is it for technical reason ? For philosophical reason ? Or just > nobody > > had needed it sufficiently to write it ? > > > > From what I understand of how Cassandra works, it seems to me that it > > could be done pretty efficiently (even though I agree that it wouldn't > > be a minor > > change). That is, it would require to add a ttl to column (and/or row). > When > > reading a column whose timestamp + ttl is expired, it would ignore it (as > for > > tombstoned column). Then during compaction, expired column would be > > collected. > > > > Is there any major difficulties/obstacles I don't see ? > > Or maybe is there some trick I don't know about that allow to do such a > thing > > already ? > > > > And if not, would that be something that would interest the Cassandra > > community ? Or does nobody ever need such a thing ? (I personally believe > it > > to be a desirable feature, but maybe I am the only one.) > > > > Thanks, > > Sylvain > > >