Eventing service data enrichment; concurrent updates CAS problem

I want to enrich my document like in this link same as case 2.

I wonder what happens if any other update comes to same document from another client during eventing service enriching the document and both eventing service and client try to update at the same time.

1 Like

Hi @mka0655 you would use couchbase.replace(…) and check for CAS refer to the scriptlet Function: Advanced REPLACE operation | Couchbase Docs on a CAS mismatch you would redo all needed logic and try again.

In the context of b2b data enrichment tools, each update operation is associated with a version number or a timestamp. When a client or service wants to update a document, it first checks the version or timestamp to ensure it matches the version of the document it has. If they match, the update is allowed, and the version is incremented. If they don’t match, it indicates that another update has occurred in the meantime, and the client needs to reconcile the changes. This approach helps maintain data consistency and integrity when multiple users or services are interacting with the same document in a b2b data enrichment scenario.

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