BoxLang native couchbase module released

Ortus Solutions Announces Release of bx-couchbase v1.0: Enterprise-Grade Couchbase + AI Integration for the BoxLang Ecosystem

Ortus Solutions is excited to announce the release of bx-couchbase v1.0, a breakthrough module that brings full Couchbase NoSQL, distributed caching, and AI vector capabilities to the BoxLang platform. The new module enables developers to build scalable, intelligent, cloud-ready applications with unprecedented ease and performance.

A New Era of Enterprise Data Access for BoxLang

Couchbase is recognized as one of the industry’s most powerful distributed databases—combining sub-millisecond key-value operations, flexible document storage, N1QL SQL-for-JSON querying, and cutting-edge vector search into a unified, globally scalable platform.

With bx-couchbase, BoxLang developers now have direct access to all of this power through an elegant, idiomatic API designed for speed, reliability, and developer joy.

Comprehensive documentation is available now at:
👉 https://boxlang.ortusbooks.com/boxlang-framework/boxlang-plus/modules/bx-couchbase

What’s New in bx-couchbase v1.0

🚀 Enterprise-Grade Distributed Caching

The module provides a full cache provider implementation backed by Couchbase’s distributed architecture—complete with automatic replication, TTL support, collections, scopes, and sub-millisecond read/write operations.

Key features include:

  • Distributed, fault-tolerant caching
  • Automatic replication across cluster nodes
  • TTL and expiration support
  • Scope/collection-based data organization
  • Seamless integration with BoxLang’s cache API
// Simple, elegant cache API
cache("default").set("user:123", {
    name: "Alice Smith",
    email: "alice@example.com",
    role: "admin"
}, 60); // 60 minute TTL

// Retrieve with null-safe Attempt monad
user = cache("default").get("user:123")
    .orElseGet( () => {
        return loadUserFromDatabase(123);
    });

🔐 True Distributed Locking for Mission-Critical Workloads

Version 1.0 introduces robust distributed locking, solving real-world problems such as double-charges, race conditions, overselling in e-commerce, and concurrency conflicts in batch jobs.

Use cases include:

  • Financial transaction coordination
  • Inventory protection under high load
  • Global job scheduling
  • User profile consistency
  • Ticketing and seat reservations

Developers may choose between:

  • Component-based locking
  • BIF callback locking
  • Manual lock management
<bx:CouchbaseLock
    name="payment-#orderId#"
    cache="default"
    timeout="5"
    expires="30">

    // Only one server processes this payment at a time
    charge = getPaymentInfo(orderId);
    result = processCharge(charge);
    updateOrderStatus(orderId, "paid");

</bx:CouchbaseLock>

For programmatic control, use the couchbaseLock() BIF with a callback:

result = couchbaseLock(
    cacheName = "default",
    name = "inventory-#productId#",
    timeout = 5,
    expires = 30,
    callback = function() {
        stock = getStock(productId);
        if (stock.quantity >= orderQty) {
            stock.quantity -= orderQty;
            saveStock(productId, stock);
            return { success: true };
        }
        return { success: false, error: "Insufficient stock" };
    }
);

🤖 AI Vector Memory Integration with bx-ai

One of the most innovative features of bx-couchbase is native support for AI vector memory through the BoxLang AI module.

This enables:

  • Persistent conversational memory
  • Semantic search for meaningful context retrieval
  • Multi-tenant isolation
  • Hybrid memory (recent + semantic context)
  • Scalable storage for thousands of conversations

Developers can now build context-aware chatbots, RAG workflows, and intelligent agents that can reason over long-term history stored in Couchbase.

// Create Couchbase-backed vector memory
memory = aiMemory("cache", {
    cacheName: "ai_memory",
    collection: "conversations._default._default",
    embeddingProvider: "openai",
    embeddingModel: "text-embedding-3-small"
});

// Build an AI agent with persistent memory
agent = aiAgent(
    name: "Customer Support Bot",
    instructions: "You are a helpful customer support agent",
    memory: memory,
    model: aiModel("openai")
);

// Conversation history automatically stored in Couchbase
response = agent.run("What did we discuss about billing?");

🛠️ Direct Access to the Couchbase Java SDK

For developers who need full control, bx-couchbase exposes direct access to:

  • Cluster
  • Buckets
  • Scopes
  • Collections
  • N1QL queries
  • Key-value operations

This opens the door to advanced use cases, custom query pipelines, and high-performance data manipulation.

// Get the cache provider
provider = couchbaseGetProvider("default");

// Access cluster
cluster = couchbaseGetCluster("default");

// Get bucket
bucket = couchbaseGetBucket("default");

// Get collection for N1QL queries
collection = couchbaseGetCollection("default");

// Execute N1QL query
result = collection.query("
    SELECT * FROM myapp
    WHERE type = 'user'
      AND status = 'active'
    LIMIT 100
");

📦 First-Class Session Storage

Applications can now store session data in Couchbase with:

  • Automatic serialization
  • High availability
  • Multi-node replication
  • Strong consistency guarantees
this.sessionStorage = "couchbase";

// Sessions automatically persisted to Couchbase
session.user = userObject;
session.cart = shoppingCart;
session.lastActivity = now();

Performance That Scales

Couchbase brings a world-class architecture to BoxLang applications, including:

  • Memory-first performance
  • Automatic sharding and rebalancing
  • Built-in replication
  • Multi-data center support
  • Sub-millisecond access time
  • Horizontal scalability across nodes

Installation and Quick Start

install-bx-module bx-couchbase

Then configure your application:

this.caches["default"] = {
    provider: "Couchbase",
    properties: {
        connectionString: "couchbase://localhost",
        username: "Administrator",
        password: "password",
        bucket: "myapp"
    }
};

You’re now ready to build the next generation of BoxLang apps.

Documentation & Community Resources


Availability

bx-couchbase is available today for BoxLang +/++ subscribers, with a limited trial available through the bx-plus module.

🔗 Plans & Pricing:
https://www.boxlang.io/plans


About Ortus Solutions

Ortus Solutions is the creator of BoxLang, ColdBox, CommandBox, and a suite of modern tools for JVM developers. Our mission is to deliver productive, modular, and modern development experiences for teams worldwide.


Media Contact

Ortus Solutions, Corp
📧 info@boxlang.io
🌐 https://www.ortussolutions.com

Total
0
Shares
Previous Post

Always Up to Date – with Every New Free PDF Edition!

Next Post

Solutions to achieve desired results from Generative AI Models

Related Posts