Congyuwang / RocksDict

Python fast on-disk dictionary / RocksDB & SpeeDB Python binding
https://congyuwang.github.io/RocksDict/rocksdict.html
MIT License
176 stars 8 forks source link

I'm trying to use the with_ttl option to automatically delete older records. #56

Closed Menziess closed 1 year ago

Menziess commented 1 year ago

After inserting a record, waiting for the desired ttl seconds, the record still exists. Are there other ways to handle automatic deletion of older records other than manually finding and deleting them?

Congyuwang commented 1 year ago

Hi, surprise to me as well. See this link: https://github.com/facebook/rocksdb/wiki/Time-to-Live

It appears that ttl in rocksdb means it will at least live that long. and the value is deleted only during compaction. So expired value may get deleted in the process when more values inserted during compaction.

From RocksDB

Some warnings: