What open source databases have features for automatic “aging out” of data, so that you can specify for how long a piece of data must be stored?
I.e. a set date or time on a piece of data, after which, the database is free to remove every trace of it.
Update:
I am more looking for an age out time of days to years, more than minutes or seconds. So a cache mechanism isn’t exactly what I am looking for.
MongoDB has something in the new release 2.2, which may be of interest – TTL Collections.
Collections expire by way of a special index that keeps track of insertion time in conjunction with a background mongod process that regularly removes expired documents from the collection. You can use this feature to expire data from replica sets and shard clusters.
It’s pretty easy to create a TTL collection from the mongo shell –
db.mycollection.ensureIndex( { "status": 1 }, { expireAfterSeconds: 3600 } )Download 2.2rc0 here (release candidate, not quite production ready…there will be one more release candidate before the production build)
Change Log here
2.2 release notes can be found here.
I can’t speak for the other solutions.