Components

Complete reference for all Couchbase module Components.

πŸ”’ Distributed Locking Components

Components for coordinating operations across multiple servers:

  • CouchbaseLock - Execute code with automatic distributed lock management

πŸ“– Usage

CouchbaseLock Component

<bx:CouchbaseLock
    name="user-#userId#-update"
    cache="default"
    timeout="5"
    expires="30">

    // Critical section - only one server executes this at a time
    user = getUser(userId);
    user.balance += amount;
    saveUser(user);

</bx:CouchbaseLock>

Last updated

Was this helpful?