Couchbase workflow
couchbase
Solution
As you said data will stay in Couchbase until the expiration time is reached: - if the expiration time is set to 0 : the data will stay until the application calls the delete() operation - if the expiration time is set to X : the data will stay in Couchbase until X (in second) is reached, and Couchbase server will automatically invalidate and delete the value.
I do not understand why you are saying "And when it is reached there is no way that Couchbase will delete them automatically", Couchbase does delete the expired item automatically: either when you try to access an expired item or using its own internal process, take a look to http://www.couchbase.com/docs/couchbase-devguide-2.0/about-ttl-values.html
So you are correct when you say you will have a "miss" (not_found) only when the key does not exist (never created or, remove from Couchbase automatically or using an explicit delete() )
Couchbase will put the item first in RAM and will write it to the disk. Couchbase is responsible to manage the memory and be its best to keep in memory the most used item. So you can obviously manage more data than the volume of your RAM, you just have to work on the good balance to have good performances and avoid I/O.
When a server is rebooted, Couchbase has all the data on the disk and will during startup populate the memory with the keys and metadata. So you do not lose anything.
I invite your to read these interesting articles/documents about Couchbase architecture: - http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-introduction-architecture.html - http://horicky.blogspot.fr/2012/07/couchbase-architecture.html
Let me know if you need more information.
Tug
Problem
I am a newbie in using Couchbase and I want to ask a question concerning Couchbase workflow. I am putting many items into the Couchbase (not a memcached one) data bucket. Am I right that these items will be in the data bucket until expiration time is reached? And when it is reached there is no way that Couchbase will delete them automatically. Actual deletion of the item will happen only if the client asks for that item. In that case Couchbase understands that the item is expired, returns null and delete item from the memory. This is important for me, because that highly affects how my solution understands item missing in the cache. If everything works as I think, then item is missing only if it hasn't been put into cache yet or has been expired or it was in memory and server was rebooted. And Couchbase will always put an item into cache even if there is no free RAM left: it will just put it into HDD, right? What happens with the items storedon HDD due to lack of RAM if server was rebooted? Will they also be erased?