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.

🎯 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.

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

πŸš€ 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:

  1. Code Usage - Learn the basic cache operations

  2. API Usage - Explore the Built-In Functions

  3. Distributed Locking - Coordinate operations across servers

  4. AI Memory - Build AI-powered applications

Need help? Check out Troubleshooting or visit our community forums.

Last updated

Was this helpful?