All values in Membase and Memcached can be set with an expiry value. The expiry value indicates when the item should be expired from the database and can be set when an item is added or updated.
spymemcached the expiry value is
expressed in the native form of an integer as per the Memcached
protocol specification. The integer value is expressed as the
number of seconds, but the interpretation of the value is
different based on the value itself:
Expiry is less than
30*24*60*60 (30 days)
The value is interpreted as the number of seconds from the point of storage or update.
Expiry is greater than
The value is interpreted as the number of seconds from the epoch (January 1st, 1970).
Expiry is 0
This disables expiry for the item.
membase.set("someKey", 3600, someObject);
The value will have an expiry time of 3600 seconds (one hour) from the time the item was stored.
membase.set("someKey", 1307458800, someObject);
Will set the expiry time as June 7th 2011, 15:00 (UTC).