Couchbase +
With the BoxLang Couchbase Module, connect to Couchbase clusters for caching, session storage, and AI vector memory.
Welcome to the BoxLang Couchbase Module! This module provides enterprise-grade caching, session storage, and AI vector memory capabilities powered by Couchbase's distributed NoSQL database.
This module is only available to +/++ subscribers only but can be installed in conjunction with the bx-plus Module with a limited trial.
π― What is Couchbase?
Couchbase is a distributed NoSQL document database with built-in caching, full-text search, and vector search capabilities. It combines the best of key-value stores with the flexibility of document databases, making it ideal for:
High-performance caching
Session and application state storage
AI vector embeddings and semantic search
Real-time applications
Multi-data center deployments
π¦ Installation
# For Operating Systems using our Quick Installer.
install-bx-module bx-couchbase
# Using CommandBox to install for web servers.
box install bx-couchbaseβ‘ Key Features
Distributed Caching
Store cache data across multiple nodes with automatic failover and replication. Sub-millisecond response times for key-value operations.
Vector Search
Built-in support for AI vector embeddings with semantic search using KNN (K-Nearest Neighbors). Perfect for RAG (Retrieval Augmented Generation) applications, chatbots, and recommendation systems.
Session Storage
Use Couchbase as your session or application scope storage backend. Automatic serialization and deserialization of BoxLang data types.
Distributed Locking
Coordinate operations across multiple servers with true distributed locks. Prevent race conditions in financial transactions, inventory updates, and batch processing.
N1QL Queries
Execute SQL++ queries (N1QL) directly from BoxLang. Full support for joins, aggregations, and complex filtering.
Cluster Support
Configure multi-node clusters with automatic discovery and failover. Supports secure connections with TLS.
π Documentation Structure
Code Usage - Working with the cache provider
API Usage - Using Built-In Functions (BIFs)
Distributed Locking - Coordinate operations across servers
Scope Storage - Session and application storage
AI Memory - Vector embeddings and semantic search
Troubleshooting - Common issues and solutions
BIF Reference - Complete BIF documentation
π Quick Example
π‘ Use Cases
π― Application Caching
Cache database query results, API responses, or computed values to reduce latency and database load.
π€ Session Management
Store user sessions in a distributed cache that survives application restarts and scales across multiple servers.
π€ AI/ML Applications
Store and search vector embeddings for semantic search, recommendation systems, and RAG chatbots.
π Distributed Coordination
Prevent race conditions and double-processing with distributed locks. Perfect for financial transactions, inventory management, and scheduled jobs.
π Real-Time Analytics
Cache aggregated metrics and dashboards with automatic expiration and refresh.
π Multi-Region Deployments
Replicate cache data across geographic regions for low-latency access worldwide.
π§ Requirements
BoxLang 1.0.0+
Couchbase Server 7.0+ (7.6+ recommended for vector search)
Java 21+
π¦ Installation
π Next Steps
Ready to dive in? Start with:
Code Usage - Learn the basic cache operations
API Usage - Explore the Built-In Functions
Distributed Locking - Coordinate operations across servers
AI Memory - Build AI-powered applications
Need help? Check out Troubleshooting or visit our community forums.
Last updated
Was this helpful?
