Document update concurrency

I use Couchbase Server 6.0.0 version and Java sdk 2.7.2.
I have some case that many client server get same document id and upsert at about the same time. So I handle upsert concurrency by getAndLock.
I know that concurrency can cotrollor CAS with out lock or getAndLock.
Which is more efficient, CAS with out lock or getAndLock, in terms of cpu usage on the Couchbase DB server?

Hi @Jingon-Park ,

In general, optimistic locking with CAS is more efficient than getAndLock.

By the way, Couchbase Server 6.0 and Java SDK 2.x have both reached end of life. Please consider upgrading when you have the opportunity.

Thanks,
David

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.