I would like to understand why the documentation talks about the 2PC protocol as a way of providing transactional logic in Couchbase. I may be wrong but this protocol is for distributed transactions and even if it could be used outside of this scope, where are the prepare and commit/rollback phases in the diagrams ? What is the benefit of having a transaction document ? Put simply, we should go back to the pre transaction state for all operations on all documents. And I’m not talking about concurrent clients that should be either blocked on document involved in a transaction or allowed to read the pre transaction version.
It seems to me that it is impossible to achieve a decent transactional behavior in a safe manner. If you really need transactional behavior you should switch to another database.