Overhead for get with cas token
Thu, 11/15/2012 - 02:56
Hello all,
I was wondering if there is a penalty incurred by always getting a value from Couchbase together with the CAS token.
I am thinking of always getting records with their respective CAS tokens, so in case I need to make a CAS operation, I already have the necessary value.
The alternative would be get the object by default without the CAS token and in case I need to make a CAS operation, I would get the object a second time, this time with the CAS token and then I would make the CAS.
Thanks.
There is no hidden overhead from getting a cas token. The cas is actually part of the memcached packet header and is returned by every operation no matter what you are doing.
If you do the following
set key1
gets key1
Then you will just incur the overhead of doing an extra operation. If the client library supports returning the cas for all operations then you should be able to retrieve the cas directly from the set meaning there is no overhead.
Which SDK are you using?