We are planning to use Couchbase documents for an application locking system,
It is guaranteed that inserting two documents in the same key, at exact same time. One of then will always fail with ‘DocumentAlreadyExistsException’ ? (We are using the Java client)
Our use case would be something like this: some process want to start, but first will try to insert a certain document with a certain key, (with a expiration time also).
If the document was inserted with success process with Start.
If the insert failed, process can’t start.
Thanks in advance