Since SSDB 1.6.7, the key expiration(TTL) feature is supported. You can set a value to a key, with a time to live. After this time, the will be automatically deleted. With this feature, you can use SSDB as a persistent cache service.
Usage:
$ssdb->setx('key', 'value', 60);
The code above set key=value, and key will be expired after 60 seconds.
Download SSDB NoSQL database: https://github.com/ideawu/ssdb
Is there a separate threads that remove expired items?
Is there a priority queue (or heap) for storing expiring keys (and finding the key with nearest expire time)?
Expire times are checked on key retrieving?
How much overhead does this feature have? (In term of disk storage, disk io, cpu time, memory)
Does this feature have a performance impact on users/keys that doesn’t use expire time?
Does the longer TTL have different processing overhead over small TTLs? (or vice-versa) Reply
Is it possible to add hsetx(name, key, value, ttl) operation for hashmap keys?
Thank you! Reply